【问题标题】:Howto hide UIPopoverController when UIWebView plays a fullscreen youtube movie?UIWebView 播放全屏 youtube 电影时如何隐藏 UIPopoverController?
【发布时间】:2011-08-01 04:12:29
【问题描述】:

请看图片。按下全屏按钮后,webviewUIPopover 后面最大化。

我试图寻找MPMoviePlayerDidEnterFullscreenNotification,但没有运气。

我真的不想发送我自己的UIPopoverController,但这是我目前唯一的"solution"。也不能使用UIWebView 以外的任何东西,因为我正在显示 YouTube 电影。

编辑:我使用UIWebView,因此无法访问内部使用的视图/类。

【问题讨论】:

  • 我怀疑这是一个 UIWebView 错误。
  • 我看到了完全相同的行为。我这边的情况相同,尝试在 UIWebView 中显示 YouTube 电影,然后全屏版本显示在 popover 控制器后面。你有没有想过解决这个问题?
  • 我知道这是一篇很老的帖子。您找到解决方案了吗?我已经为此做了一些解决方法。就像检查 MPMoviePlayerDidEnterFullscreenNotification 并在其中关闭 UIPopover 一样。发生这种情况时您遇到了什么问题?
  • 我最终没有为此使用弹出框,因此解决了这个问题。这也是相当长的一段时间,也许苹果已经解决了这个问题。

标签: ios uiwebview youtube


【解决方案1】:

根据this answer可以收听UIMoviePlayerControllerDidEnterFullscreenNotification

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];

【讨论】:

  • @steipete 另一种选择是在 UIApplication 的窗口堆栈上使用 KVO。当一个窗口被添加到该堆栈时,隐藏你的弹出窗口。
猜你喜欢
  • 2011-05-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-10
  • 2012-01-29
  • 2011-04-27
  • 2011-02-12
  • 1970-01-01
相关资源
最近更新 更多