你好,我正在开发一个在应用程序中播放视频的应用程序
我已经使用以下代码-

MPMoviePlayerViewController *theMovie=
[[MPMoviePlayerViewController alloc] initWithContentURL: myurl];
theMovie.moviePlayer.repeatMode=MPMovieRepeatModeOne;
theMovie.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
[theMovie.moviePlayer play];
[self.view addSubview:theMovie.view];


但是我想从视频控制器中删除此状态栏,请参阅附件。ios - MPMoviePlayerViewController状态栏未隐藏-LMLPHP

最佳答案

试试这个代码,

ViewDidLoad方法:

    float delay = 0.1;

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC),  dispatch_get_main_queue(), ^{
    [UIApplication sharedApplication].statusBarHidden = NO;


ViewWillAppear方法给出以下代码:

[UIApplication sharedApplication].statusBarHidden = NO;


希望对您有所帮助

10-08 20:03