美文网首页
iOS web 页面播放视频时,状态栏被隐藏了

iOS web 页面播放视频时,状态栏被隐藏了

作者: 小码农小世界 | 来源:发表于2019-07-10 11:42 被阅读0次

iOS web 页面播放视频时,状态栏被隐藏了。
解决方法是添加全屏和退出全屏的消息。

//监听UIWindow显示
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(beginFullScreen) name:UIWindowDidBecomeVisibleNotification object:nil];
//监听UIWindow隐藏
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(endFullScreen) name:UIWindowDidBecomeHiddenNotification object:nil];

退出全屏的方法

-(void)endFullScreen{
    NSLog(@"退出全屏");
    [[UIApplication sharedApplication]setStatusBarHidden:false animated:false];
}

相关文章

网友评论

      本文标题:iOS web 页面播放视频时,状态栏被隐藏了

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