设置statusbarStyle不起作用
如果要每个页面自定义style,需要在info.list中设置View controller-based status bar appearance = YES
然后在每个viewController中设置(可在基类中也统一设置,需要改变style的时候重写覆盖)
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;//or UIStatusBarStyleLightContent
}
但是,
原因是你的viewController嵌在NavigationController中!
- (UIViewController *)childViewControllerForStatusBarStyle {
return self.topViewController;
}
- (UIViewController *)childViewControllerForStatusBarHidden {
return self.topViewController;
}
才行!
网友评论