Search code examples
iosbackgroundios7xcode5uinavigationitem

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?


Solution

  • Use this:

        self.navigationController.navigationBar.barTintColor = [UIColor redColor];
        self.navigationController.navigationBar.translucent = NO;