2 alllllllll alllllllll 于 2013.04.17 16:41 提问

在播放视频的时候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];

1个回答

Chengzi_963
Chengzi_963   2013.04.17 17:33
已采纳

用下面的代码隐藏状态条

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

或者

mpviewController.controlStyle = MPMovieControlStyleFullscreen;

或者:

[self setWantsFullScreenLayout:YES];
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!