How to change navigation bar color in iOS 7 or 6?

EGHDK picture EGHDK · Aug 11, 2013 · Viewed 118.5k times · Source

I want to change the color of the navigation bar color, but I'm not sure whether or not I should change the tint or the background. I know iOS 7 is going for a more flat design (even recommending removing gradients), but I am having trouble deciphering the two. Even if I set a background color, it doesn't do anything.

In this image, the background is set to green, but the bar is still blue:

Enter image description here

Answer

Mahesh picture Mahesh · Sep 2, 2013

The behavior of tintColor for bars has changed on iOS 7.0. It no longer affects the bar's background and behaves as described for the tintColor property added to UIView. To tint the bar's background, please use -barTintColor.

navController.navigationBar.barTintColor = [UIColor navigationColor];