简单区分下设置导航栏各部分颜色的方法
2016-08-14 本文已影响21人
马铃薯蜀黍
- 设置背景图片的方法
//第一种方法
[self.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bac"]forBarMetrics:UIBarMetricsDefault] ;
//第二种方法
self.navigationBar.barTintColor = [UIColor redColor];


- 设置标题文字颜色的方法
NSDictionary * dic = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
[self.navigationBar setTitleTextAttributes:dic];

- 将返回的barbuttonItem 以及 rightBarButtonItem 改变颜色的方法 :
self.navigationBar.tintColor = [UIColor whiteColor];

个人感觉基本上这样应该就够用了,希望能够帮到你~