1.在plist里面, 加上View controller-based status bar appearance, 并且设置为NO
- 然后在需要更改颜色的控制器里添加如下代码:
self.navigationController.navigationBar.barStyle. = UIStatusBarStyleDefault;
[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
3.或者在控制器基类的viewDidLoad方法中写上以下代码
if (self.navigationController) {
self.navigationController.navigationBar.barStyle = UIStatusBarStyleDefault;
[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
}