1、在plist文件中添加一个属性 View controller-based status bar appearance 设置为 NO
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
2、View controller-based status bar appearence 设置为 YES
注意:如果 View controller-based status bar appearence 为 YES,则 [UIApplication sharedApplication].statusBarStyle 在工程里面设置是无效的。
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
或者重写 preferredStatusBarStyle 方法(修改单个页面)
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleLightContent;
}