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