美文网首页
webView打开视频全屏,导致导航条消失

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

作者: 柠檬初上_4ab4 | 来源:发表于2019-03-25 10:00 被阅读0次

参考链接 :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打开视频全屏,导致导航条消失

      本文链接:https://www.haomeiwen.com/subject/fmomvqtx.html