在 iPad 中旋转全屏视频时,导航栏和状态栏之间出现奇怪的重叠错误
我正在我的应用程序中实现一个视频播放器,当视频播放器全屏工作时旋转 iPad 时会发生奇怪的事情。
我的测试用例很简单:
1.- 我将方向设置为垂直
2.- 我开始视频播放(非全屏)
3.- 我设置全屏
4.- 我在全屏时旋转 iPad 并将其设置为水平
5.- 我回到“非全屏”
6.- 导航和状态栏以一种非常愚蠢的方式重叠。看:
7.- 然后我再次将 iPad 旋转至垂直
状态和导航栏不再重叠。再看一遍:
8.- 然后我来回旋转到水平和垂直,一切都正常。
提示?
我读过其他一些问题,但没有得出明确的结论。 苹果(?)有一些“官方”修复,承认存在某种错误,并尝试修复类似的情况,如下所示: 使用 MPMoviePlayerViewController 时的 iPad 旋转错误
但即使实现了这个简单的解决方案,该错误仍然出现 为我。 (我不知道这是否是一个错误,或者它甚至可能是一个功能(?))
我会尝试更多的混乱,但非常欢迎帮助。
问候
I'm implementing a video player inside my application and strange things happen when rotating the iPad when the video player is working in full screen.
My test case is kind of easy:
1.- I set orientation to Vertical
2.- I start video playing (non full screen)
3.- I set full screen
4.- I rotate the iPad while in fullscreen and set it to horizontal
5.- I go back to "non full screen"
6.- Navigation and status bar become overlapped overlapped in a very silly way. Look:
7.- Then I rotate the iPad to Vertical again
Status and Navigation Bars don't overlap anymore. Look again:
8.- Then I rotate back and forth to Horizontal and Vertical, and everything keeps being OK.
Hints?
I've read some other questions around, but no clear conclusion comes to my mind.
There are some "official" fixes from apple (?) acknowledging some kind of bug, and trying to fix similar situations, like here: iPad rotation bug when using MPMoviePlayerViewController
But even implementing that easy solution, the bug still appears for me.
(I don't know if it's a bug, or it might even be a feature (?))
I'll be trying some more messing, but help will be more than welcome.
Greetings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在替换
rootViewController
之前取消隐藏状态栏可以解决此错误:Unhiding the status bar BEFORE replacing
rootViewController
works around this bug:效果很好
It works perfectly
你可以试试这个代码
You can try this code