I have a project using Storyboards and whenever I push a view controller with a segue, the dynamically created bar button item is always blue.
It's driving me nuts. Because this object is created dynamically, I cannot set its color in IB (like I have done with previous bar button items).
Among the solutions I have tried are:
- Set it in the receiver's
viewDidLoad
Set it in the receiver's viewDidAppear
self.navigationItem.backBarButtonItem.tintColor = [UIColor whiteColor];
When I saw that didn't quite work, I tried setting the leftBarButtonItem instead:
self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
I have tried the following code (which I got from other SO answers) in my app's delegate, when the new view gets called, and before pushing the new view:
[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];
All the google answers I have found recommend to use the code above, but it's not working at all for me. Maybe there are some changes in iOS 7's appearance API? No matter how or where I try to set "Categorías" to white, it's always the default blue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…