views:

371

answers:

1

Hi,

How can I change the color of navigation bar from its default blue color?

Thanks.

+1  A: 

The UINavigationBar class has a UIColor *tintColor property that you can change in code.

Alternately this property is also exposed in the InterfaceBuilder UI design tool.

CynicismRising
Thanks for your reply. Could you pls let me know if I can use an image as navigation bar background?
ebaccount
To set it to an image you could try use a pattern for your UIColor:UIImage *patternImage = [UIImage imageNamed:@"background.png"];UIColor *myColor = [UIColor colorWithPatternImage: patternImage];yourNavigationController.navigationBar.tintColor = myColor;I've not tried this, so YMMV. If it doesn't work, you'll have to subclass the UINavigationBar (Not the simplest of tasks).
pixel