Reputation: 7764
I can't change the color of my UINavigationBar.
I've put a navigation bar manually using Interface Builder, but I can't change its color to the following settings. I'm putting this code on ViewDidLoad (the code works fine with other classes on my app, except this one, where I'm using the UINavigationBar via IB):
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.122 green:0.467 blue:0.255 alpha:1.00];
Any suggestions? Thank you!
Upvotes: 1
Views: 528
Reputation: 6468
Did you check that you have the navigation bar connected through IB? as in, Did you declare a IBOutlet UINavigationBar in your controller, and then connected the navigation bar in IB to it's outlet?
Upvotes: 2
Reputation: 17724
You might not be on the navigation controller stack at this point. Trying putting it in viewWillAppear:
EDIT: You can check this by seeing if self.navigationController.navigationBar returns nil.
Upvotes: 2