user945620
user945620

Reputation:

Setting the background color of UINavigationBar has no effect?

For most iOS widgets I can set the background color. It appears that UINavigationBar is not this way. Furthermore I cannot set the navigation item (top item)'s background as it does not respond to setBackgroundColor.

How can I change that color? Thanks.

Upvotes: 2

Views: 8606

Answers (3)

user1770342
user1770342

Reputation: 151

Change it by following code:

self.navigationController.navigationBar.tintColor=[UIColor grayColor];

Upvotes: 3

Tiquelou
Tiquelou

Reputation: 459

Easiest way would be to use the Interface Builder:

UINavigationBar Properties

Upvotes: 0

superjessi
superjessi

Reputation: 1790

You should use setTintColor: instead:

[self.navigationController.navigationBar setTintColor:[UIColor redColor]];

Hope this helps!

Upvotes: 5

Related Questions