1.在plist中配置
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
2.在需要控制的控制器写入这段代码
- (BOOL)prefersStatusBarHidden {
return YES;
}
3.在UINavigationController中写入以下代码
- (BOOL)prefersStatusBarHidden{
return self.topViewController.prefersStatusBarHidden;
}
网友评论