设置StatusBarOrientation导致iOS 8中出现问题

时间:2014-09-23 19:16:57

标签: iphone opengl-es interface orientation ios8

我在iOS8下的应用程序遇到了实际问题。我制作了一堆基于OpenGL的应用程序,它们不需要iOS来处理方向。它全部在OpenGL部分内处理。但我确实使用setStatusBarOrientation来确保弹出的任何对话框/键盘等与其他所有内容对齐。我以编程方式或在xib中创建窗口和视图,我从不需要使用故事板(如果相关的话?)

这一切都很完美,直到iOS 8出现。

现在似乎setStatusBarOrientation根本没有正常运行。它要么不改变任何东西,要么它正在旋转"某些东西"停止触摸记录在屏幕的一半。就像窗户在自身内部旋转一样,但在视觉上没有任何变化,只是接触会受到影响。

很难解释,没有任何意义。

但我的问题是:如何在iOS8中设置状态栏方向?如何在不破坏以前iOS版本中的所有其他功能的情况下执行此操作?

2 个答案:

答案 0 :(得分:0)

将iOS7.1设置为您的Base SDK,它可以在iOS8上正常运行,没有所有这些奇怪的错误。

http://objcsharp.wordpress.com/2014/09/21/how-to-get-back-the-ios-7-sdk-after-upgrading-to-xcode-6/

答案 1 :(得分:-2)

发现了这个

if ([UIViewController class]) // iOS8 has this class only
{
    [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationPortrait] forKey:@"orientation"];
}

在这里找到: http://blog.lessfun.com/blog/2014/09/24/ios8-issue-keyboard-orientation-and-idletimerdisabled-not-working/

似乎有用