iOS 网页(WKWebView)加载视频后没有状态栏了
作者:
择一城终老_蜗牛 | 来源:发表于
2019-04-26 20:45 被阅读0次//在web页面直接添加观察者
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(windowDidBecomeHidden:) name:UIWindowDidBecomeHiddenNotification object:nil];
-(void)windowDidBecomeHidden:(NSNotification *)noti{
UIWindow * win = (UIWindow *)noti.object;
if(win){
UIViewController *rootVC = win.rootViewController;
NSArray<__kindof UIViewController *> *vcs = rootVC.childViewControllers;
if([vcs.firstObject isKindOfClass:NSClassFromString(@"AVPlayerViewController")]){
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
}
}
}
本文标题:iOS 网页(WKWebView)加载视频后没有状态栏了
本文链接:https://www.haomeiwen.com/subject/gxqcnqtx.html
网友评论