支持iOS 6和iOS 5自动旋转 [英] Supporting both iOS 6 and iOS 5 autorotation

查看:105
本文介绍了支持iOS 6和iOS 5自动旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以确认,为了支持iOS 6和iOS 5,没有必要添加新的iOS 6自动旋转方法,因为如果您还要实现iOS 5方法,那么Apple文档会建议完全忽略这些方法吗? / p>

具体地讲,我说的是方法 - (NSUInteger)supportedInterfaceOrientations - (BOOL )shouldAutorotate - 这些被忽略,合成由编译器,如果你也实现了 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

解决方案

如果要在新的sdk中打包应用程序,则需要为自动旋转添加新的回调。但是,只有在iOS 6设备上运行此类应用程序时才会收到这些回调。对于在早期iOS版本上运行的设备,将收到早期的回调。如果你没有实现新的回调,默认行为是你的应用程序在iPad上的所有方向上运行,除了iPhone上的UpsideDown方向以外的所有方向。


Can anyone confirm that to support both iOS 6 and iOS 5 there is no point to adding the new iOS 6 autorotation methods, since the Apple docs suggest that these methods are completely ignored if you are also implementing the iOS 5 methods?

In particular, I talking about the methods - (NSUInteger)supportedInterfaceOrientations and - (BOOL) shouldAutorotate -- that these are ignored and synthesized by the compiler if you also implement the - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

解决方案

You need to add new callback for autorotation if you are packaging your app in the new sdk. However, these callbacks will be received only when such an app is run on iOS 6 devices. For devices running on earlier iOS versions, earlier callbacks would be received. If you dont implement the new callbacks, the default behavior is that your app runs on all orientation on iPad and all except UpsideDown orientation on iPhone.

这篇关于支持iOS 6和iOS 5自动旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆