【问题标题】:setStatusBarOrientation causing problems in iOS8setStatusBarOrientation 在 iOS8 中导致问题
【发布时间】:2014-11-18 03:01:12
【问题描述】:

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

在 iOS 8 出现之前,一切都很完美。

现在看来 setStatusBarOrientation 的行为根本不正常。它要么没有改变任何东西,要么正在旋转“某物”,停止在一半屏幕上记录触摸。就好像窗口在自身内部旋转,但视觉上没有任何变化,只是触摸受到影响。

这很难解释,而且毫无意义。

但我的问题是:如何在 iOS8 中设置状态栏方向?以及如何在不破坏以前 iOS 版本中所有其他功能的情况下做到这一点?

【问题讨论】:

  • 我遇到了完全相同的问题。我正在使用 CGAffineTransformMakeRotation 手动旋转视图。
  • 也有与@jarrold 相同的问题。你能找到解决方法吗?

标签: iphone opengl-es interface orientation ios8


【解决方案1】:

将 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/

【讨论】:

    【解决方案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/

    似乎有效

    【讨论】:

    • 但是,如果在应用商店中有一个应用,这是否符合犹太教规?
    猜你喜欢
    • 2012-06-03
    • 1970-01-01
    • 1970-01-01
    • 2014-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-08
    • 2014-12-15
    相关资源
    最近更新 更多