手动控制显示和隐藏状态栏 setNeedsStatusBarAppearanceUpdate

#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];  
posted @ 2017-02-23 15:02  ID_超电磁炮  阅读(482)  评论(0编辑  收藏  举报