2

How can I get a matte color on a UINavigationBar instead of the shiny look?

[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556

2 Answers2

2

There's no built-in way to do this. Using tintColor will always get you the default "shiny" look. The alternative is to draw the bar yourself, using the technique described here, to get the look you want.

Community
  • 1
  • 1
jtbandes
  • 115,675
  • 35
  • 233
  • 266
  • 1
    FWIW, it seems that the most voted and accepted answer is **not** a good idea, since it apparently (see comments there) won't work in iOS5. The UINavigationBar must be subclassed, not extended with a category that overrides `drawRect:` – Rudy Velthuis Aug 23 '11 at 23:10
  • Why subclass? In iOS 5 there is a method `setBackgroundImage:forBarMetrics:` so in your category why not do a `respondsToSelector:` check first then use the appropriate method? – Paul.s Oct 30 '11 at 00:24
0

My simple way using category UINavigationBar:

@implementation UINavigationBar (UINavigationBarWithoutShiny)
- (void)drawRect:(CGRect)rect {}
@end

after this i can use just background color of UINavigationBar view:

self.navigationController.navigationBar.backgroundColor = [UIColor greenColor];
buh
  • 440
  • 2
  • 12