if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
- (BOOL)prefersStatusBarHidden
{
return YES;//隐藏为YES,显示为NO
}
或者设置plist文件全局
设置key:Status bar is initially hidden YES
设置key:View controller-based status bar appearance NO
时间: 2024-10-11 01:25:20