方法 1
在项目的plist中 添加 2 项
首先设置key:Status bar is initially hidden 为YES
然后设置key:View controller-based status bar appearance 为NO
方法 2
在 viewController 子类中添加
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[selfprefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
- (BOOL)prefersStatusBarHidden
{
returnYES;//隐藏为YES,显示为NO
}