0

Im attempting to set only the rightBarButtonItem of my navigationItem's on navigationBar. I'm using this code:

[self.navigationController.navigationBar setTintColor:[UIColor redColor]];
[self.navigationItem.rightBarButtonItem setTintColor:[UIColor whiteColor]];

The second line does nothing however and both the left and right UIBarButtonItem stay red. What could be causing this issue?

I have also tried:

[self.navigationController.navigationBar setTintColor:[UIColor redColor]];
[self.rightBarButtonReferenceIBOutlet setTintColor:[UIColor whiteColor]];

I have also tried just using this line of code:

[self.navigationItem.rightBarButtonItem setTintColor:[UIColor redColor]];

And the right bar button remains red. I cannot figure out what is causing this issue.

PS.. still no answer Set color of one UIBarButtonItem using IBOutlet Also seems the same issue is here UIBarButtonItem setTintColor doesn't work on iOS7

Community
  • 1
  • 1
Chisx
  • 1,976
  • 4
  • 25
  • 53
  • Just tried and worked for me :/ I created a new Xcode project with a master/detail template, put those two lines at the end of the `viewDidLoad` and it worked. Where did you put those lines? What is your iOS target (iOS9 for me) – Quentin Ribierre Jan 07 '16 at 23:28
  • Navigation bar tint color will influence on all view controllers in navigation.But item only one. – Lumialxk Jan 07 '16 at 23:35
  • @QuentinRibierre I put it at the end of the viewDidLoad, it doesn't work for me? is something overriding this? – Chisx Jan 07 '16 at 23:47
  • Word. Try to put some breakpoint I guess then? To see if it's overridden or not? – Quentin Ribierre Jan 07 '16 at 23:56
  • Breakpoint is not going to show me if its overidden, Im not sure where I would check to see if the property is overidden? – Chisx Jan 08 '16 at 00:04
  • @Chisx : Are you using only the text or any custom image for bar button ? and also the above code works for me in iOS (9.0, 9.1). – Ramkrishna Sharma Jan 12 '16 at 06:51

0 Answers0