开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜