How to setTintColor for backButton in navigationBar

241 views Asked by At

I tried to do it with a lot of ways, but it didn't work. Show me the way to do it please.

[[[[[self navigationController] navigationBar] backItem] backBarButtonItem] setTintColor: [UIColor whiteColor]];

This code didn't work

4

There are 4 answers

0
Daniel Larsson On BEST ANSWER

In iOS 7, tint color is a property of UIView. If not set, this is inherited. Setting the tint color of the navigation bar itself will affect subviews of it, but not the actual background of the bar (liked it used to in iOS 6).

Try this:

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
0
rshankar On

Try this one.

  [[[self navigationController] navigationBar] setTintColor: [UIColor whiteColor]];
0
Dev On

You can try this.

[[UIBarButtonItem appearance] setTintColor:[UIColor purpleColor]];
0
amitshinik On

To change back button chevron throughout the entire app do this:

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

*Note that if you are using more than 1 UINavigationController, you will have to set this for each one.