#pragma mark iPhoneX及全屏手机模态视图是不能隐藏状态栏的,所以可以使其带有导航视图控制器就可以隐藏了
//在试图将要已将出现的方法中
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
//调用隐藏方法
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
}
-(BOOL)prefersStatusBarHidden {
return YES;
}
网友评论