【问题标题】:statusBar not hiding while playing video [duplicate]播放视频时状态栏不隐藏[重复]
【发布时间】:2013-04-17 04:23:37
【问题描述】:

我在播放视频时使用[[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];

【问题讨论】:

标签: iphone objective-c media-player


【解决方案1】:

使用下面的线隐藏状态栏...

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

否则使用此波纹管..

mpviewController.controlStyle = MPMovieControlStyleFullscreen;

[self setWantsFullScreenLayout:YES];

【讨论】:

  • @Ram 使用这条线它会工作.. [self setWantsFullScreenLayout:YES]; :)
  • 你试过最重要的选项??
  • @Nitin Gohel:如果我得到答案,我应该接受。没有得到答案我怎么能接受?这种方法对我不起作用。不知道就不要说出来吗?
  • @Ram 这个代码问题必须解决老兄.. [self setWantsFullScreenLayout:YES];或 [mpviewController setWantsFullScreenLayout:YES];
  • @Ram 也可以从这个链接看到我的回答。stackoverflow.com/questions/12929951/…
猜你喜欢
  • 2011-03-13
  • 1970-01-01
  • 2020-02-20
  • 2013-09-20
  • 2016-07-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多