【问题标题】:supportedInterfaceOrientations - Supporting iOS6 and iOS5supportedInterfaceOrientations - 支持 iOS6 和 iOS5
【发布时间】:2012-10-09 16:47:05
【问题描述】:

只是一个简单的问题。假设我已将我的应用程序更新到 iOS6 并更改了 iOS5 的 shouldAutoRotate 方法,如下所示:

- (BOOL) shouldAutorotate
{
return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight;
}

如果我仍然支持 iOS5,如果应用在运行 iOS5 的设备上运行,我是否需要检查 iOS 版本,然后还包括旧的 iOS5 方法(即 shouldAutoRotateToInterfaceOrientation)?

谢谢!

【问题讨论】:

    标签: iphone ipad ios5 rotation ios6


    【解决方案1】:

    在您的应用中同时包含 iOS5 和 iOS6 代码是可以的。

    在 iOS5 上,supportedInterfaceOrientations 和 shouldAutorotate 不会被调用,在 iOS6 上旧方法 shouldRotateToInterfaceOrientation 等不会被调用。

    【讨论】:

    • 啊,太好了 - 谢谢。我想知道最终旧的iOS5版本是否会在编译时被标记为已弃用。
    • 我希望这会在 iOS7 左右发生
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-09-15
    • 2012-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-05
    相关资源
    最近更新 更多