#pragma mark 播放的时候显示
- (void)PlayWith:(NSURL *)url AndVideoName:(NSString *)name
{
_statusBarHide = YES;
[self setNeedsStatusBarAppearanceUpdate];
...
}
- (BOOL)prefersStatusBarHidden
{
if (_statusBarHide == YES) {
return YES;
}
else{
return NO;
}
}
#pragma mark 关闭的时候隐藏
- (void)closePlayer
{
_statusBarHide = NO;
[self setNeedsStatusBarAppearanceUpdate];
}
注意:
[self setNeedsStatusBarAppearanceUpdate];