setStatusBarOrientation导致iOS8出现问题

Rob*_*Rob 5 iphone interface opengl-es orientation ios8

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

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

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

这很难解释,也没有意义.

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

小智 -2

找到了这个

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

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

似乎有效