webView打开视频全屏,导致导航条消失

参考链接 :https://stackoverflow.com/questions/35804693/navigation-bar-under-status-bar-after-video-playback-in-landscape-mode

- (void)viewDidLoad {
[super viewDidLoad];
// 监听横竖屏、widow变化,防止视频全屏影响状态栏条消失   但是还是有漏网之鱼
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self
           selector:@selector(setNeedsStatusBarAppearanceUpdate)
               name:UIDeviceOrientationDidChangeNotification
             object:nil];
[center addObserver:self
           selector:@selector(setNeedsStatusBarAppearanceUpdate)
               name:UIWindowDidBecomeHiddenNotification
             object:nil];
}
 - (BOOL)prefersStatusBarHidden {
     return UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation);
 }

你可能感兴趣的:(webView打开视频全屏,导致导航条消失)