iphone - supportedInterfaceOrientations - 支持 iOS6 和 iOS5

标签 iphone ipad ios5 rotation ios6

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

- (BOOL) shouldAutorotate
{
return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight;
}

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

谢谢!

最佳答案

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

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

关于iphone - supportedInterfaceOrientations - 支持 iOS6 和 iOS5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12804695/

相关文章:

iphone - 基础 SDK 和部署目标或部署操作系统版本之间的真正区别是什么?

iphone - 类似于 iTunes 的 iOS 气泡弹出菜单

ios5 - Airplay 镜像 + 外部 UIScreen = 全屏 UIWebView 视频播放?

iphone - Xcode游戏声音可以在Sim和iPad上播放,但不能在iPhone 6上播放

iphone - CGAffineTransform 旋转 90 度

objective-c - 自定义 UIButton 背景图像显示在 iOS 6 但不是 iOS 5

ios - 不兼容的指针类型将 'UITapGestureRecognizer *' 发送到类型 'UIView * _Nonnull' 的参数

iphone - cocos2d 和 box2d : camera rotation

iphone - 翻转 View 动画不起作用

iphone - iOS 4 + MPMoviePlayerController