Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background color of UINavigationItem

I've got a couple of View Controllers that are added in the 'default Navigation Controller' of Xcode 5. I Want to change the color of the bar, but it doesn't work. This is the code I use:

[[UINavigationBar appearance] setTintColor:[UIColor redColor]];

This will only change the text in the navigation bar, not the background color. Can anybody point me in the right direction?

like image 348
Jente Avatar asked Jan 08 '14 19:01

Jente


1 Answers

Use this:

    self.navigationController.navigationBar.barTintColor = [UIColor redColor];
    self.navigationController.navigationBar.translucent = NO;
like image 122
Prince Agrawal Avatar answered Oct 03 '22 22:10

Prince Agrawal