在播放视频的时候statusBar隐藏

使用[[UIApplication sharedApplication] setStatusBarHidden:YES];来隐藏状态条。但是状态条还是显示。

代码:

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];

用下面的代码隐藏状态条

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

或者

mpviewController.controlStyle = MPMovieControlStyleFullscreen;

或者:

[self setWantsFullScreenLayout:YES];