iPad 状态栏在视频播放期间旋转后粘住
我很难让它发挥作用,苹果开发者论坛也没有提供任何帮助。
我有一个播放视频的应用程序,当显示影片控件并且旋转 iPad 时,状态栏会保持在方向开始之前视频所在的方向。然后,视图顶部有一个 20px 的间隙,而状态栏处于另一个方向。
有人见过这个问题吗?
任何帮助将不胜感激。
I am having a terrible time getting this to work, and the Apple Developer forum has been of no help.
I have an application that plays video and when the moviecontrols are displayed and the iPad is rotated, the status bar sticks to the orientation that the video was in before the orientation begins. Then there is a 20px gap at the top of the view while the statusbar in another orientation.
Has anyone seen this problem?
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,而且在将电影播放器返回到窗口模式后,我的视图仍然混乱。我不知道如何在全屏播放期间解决这个问题,但至少在切换回窗口后,您可以像这样修复状态栏:
在计时器函数中执行
[[UIApplicationsharedApplication]setStatusBarOrientation:[[UIDevice currentDevice]orientation]animated:NO];
I had the same issue, plus my view was still screwed up after returning the movie player to windowed mode. I don't know how to fix this during fullscreen play, but at least after switching back to windowed you can fix up the status bar like this:
in the timer function do
[[UIApplication sharedApplication] setStatusBarOrientation:[[UIDevice currentDevice] orientation] animated:NO];
我遇到了同样的问题:
presentModalViewController
显示)。退出视频。嘭!我们的应用程序的布局被破坏(我们为每个方向做了一些自定义布局),并且状态栏位于错误的位置,尽管在视频中处于正确的位置。
我做了两件事来解决这两个问题:
viewWillAppear
中完成的自定义配置是在调用[super viewWillAppear];
之后完成的。观察者回调的代码如下所示:
最后的方法,在有意的 0 延迟后调用:
状态栏仍然有明显的闪烁,但这是我想到的最好的方法。
希望这有帮助。
编辑:我已经删除了performSelector步骤,并直接调用状态栏设置,在我的情况下,它没有明显的区别(仍然闪烁)。
I had the same problem:
presentModalViewController
).Bam! Our application's layout is broken (we do some custom layout for each orientation), and the status bar is at the wrong place, despite being at the correct place when in video.
I did two things to fix the two issues :
viewWillAppear
, is done AFTER calling[super viewWillAppear];
.MPMoviePlayerDidExitFullscreenNotification
andMPMoviePlayerPlaybackDidFinishNotification
(the first one never got called when clicking 'Done' in my case).The code for the observer's callback is looking like this:
And the final method, called after an intentional 0 delay:
There is still a perceivable blinking of the status bar, but that's the best I came up with.
Hope this helps.
EDIT: I've removed the
performSelector
step, and directly called the status bar setup, in my case, it makes no noticeable difference (still blinking).