私は一日中非常に厄介な問題に苦しんでいます、そして私はこのボードで助けを見つけることができればと思います。
私はMPMoviePlayerControllerを使用してiPadでフルスクリーンの映画を再生していますが、地獄に行くためのあらゆる努力にもかかわらず、常に表示されるステータスバーを削除する方法がわかりません。
これが私が映画を表示するために使用する方法のコードです:
-(void)launchVideoFromButton:(id)sender{
NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"movie01" ofType:@"m4v"];
NSURL *videoPathURL = [NSURL fileURLWithPath:videoPath];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoPathURL];
[self.view addSubview:moviePlayer.view];
moviePlayer.shouldAutoplay = YES;
moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[moviePlayer setFullscreen:YES animated:YES];
moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self selector:@selector(moviePlayerEvent:) name:MPMoviePlayerLoadStateDidChangeNotification object:moviePlayer];
}
-(void)moviePlayerEvent:(NSNotification*)aNotification{
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
NSLog(@"%i", [UIApplication sharedApplication].statusBarHidden);
}
コンソールでは、ムービーが表示されたときにmoviePlayerEventが起動されますが、ステータスバーはまだそこにあります:[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO]は動作していないようです。私は運が悪かった他のMPMoviePlayerController通知を使用しようとしてきました。
誰かがそれについて私を助けてもらえますか?
前もって感謝します。