I have a UINavigationItem
, but I can't found anything beside tittle, prompt, and back button in attribute inspector
I wonder how can I change my UINavigationItem
background color using code? or programmatically?
I have a UINavigationItem
, but I can't found anything beside tittle, prompt, and back button in attribute inspector
I wonder how can I change my UINavigationItem
background color using code? or programmatically?
You can change it through code...
For Objective-C:
Write Above line in viewDidLoad method.
For Swift:
OR
You can change color on your own choice.
To change the bar Text...
See the Link.... Here
See the above image... you like output like this screen right...!!!
You shouldn't use the background property of UINavigationBar, but instead you should use barTintColor like this:
As written in the official documentation to change the bar background you have to access to the barTintColor property:
If you want to edit the style of the navigation bar such as button color you should access to the barTint property. If you want to edit the style of an navigationItem such as back button you should edit the button property, not the UINavigationItem's.
One possible solution is to embed the View Controller it is containing the Navigation Item in a Navigation Controller and access to properties color of Navigation Bar: