How can I get a 'matte' color on a UINavigationBar?
How can I get a matte color on a UINavigationBar instead of the shiny look?
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]]开发者_如何学编程;
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.
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];
精彩评论