使用[[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];