statusBar在播放视频时没有隐藏

时间:2013-04-17 04:23:38

标签: iphone objective-c media-player

我在播放视频时使用[[UIApplication sharedApplication] setStatusBarHidden:YES];隐藏状态。但是statusBar正在显示。

代码:

MPMoviePlayerViewController *mpviewController = [[MPMoviePlayerViewController alloc]initWithContentURL:[NSURL fileURLWithPath:path]];
[mpviewController.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
[self.view addSubview:mpviewController.view];
[[UIApplication sharedApplication]setStatusBarHidden:YES];
[self presentMoviePlayerViewControllerAnimated:mpviewController];

1 个答案:

答案 0 :(得分:4)

使用波纹管线隐藏statusBar ...

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];

否则使用此波纹线..

mpviewController.controlStyle = MPMovieControlStyleFullscreen;

[self setWantsFullScreenLayout:YES];