状态栏方向问题
我的 iPad 应用程序上的应用程序状态栏出现此问题。
我正在使用 UINavigationController。根视图控制器通过在 shoulAutoRotate 方法中返回 YES 来允许所有旋转。这个根视图控制器在纵向或横向方向上有两种不同的外观,我已经设法以编程方式对其进行修改,而无需使用 nib 文件。
问题是,当我横向启动应用程序时,有时状态栏会纵向显示。这将导致视图顶部出现白条,或者在 iPad 处于横向模式时强制 VC 加载纵向视图。
我验证了我的 plist 文件,并且它已正确设置为所需的方向。
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
发生的另一件事是,当我在横向模式下推动视图控制器时,不会显示状态栏,它会正确消失。但是,当导航控制器弹出该 vc 时,状态栏将返回纵向甚至纵向颠倒。
这是一个错误还是我做错了什么? 我可以输入很多代码,但我不想让问题变得不可读。请随意询问您需要的代码的任何部分。
提前致谢!
I'm having this issue with the application status bar on My iPad app.
I'm using a UINavigationController. The root view controller allows all rotations by returning YES in the shoulAutoRotate method. This root view controller has two distict looks when it comes to portrait or landscape orientation, which I have managed to modify programmatically without using a nib file.
The thing is that when I start my App in landscape, sometimes the status bar will be in portrait. This will either cause a white bar on top of the view, or to force the VC to load the portrait view when the iPad is in landscape mode.
I verified my plist file and it's correctly set up for the orientations needed
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
The other thing that happens is that when I push a view controller in landscape mode, that does not show the status bar, it will disappear correctly. But then when that vc is popped by the navigation controller, the status bar will return in portrait or even portrait upside down.
Is this a bug or am I doing something wrong?
I could put lots of code but I don't want to make the question unreadable. Feel free to ask whatever part of the code you need.
thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
try: