iOS 6 自动旋转混乱 [英] iOS 6 auto rotate confusion

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

问题描述

我的整个界面都在一个 Storyboard 中.我怎样才能使大多数 ViewController 只支持纵向,而只有一对支持所有方向.我无法理解苹果新的自动旋转系统.另外,我怎样才能使它向后兼容 iOS 5?

I have my entire interface in one Storyboard. How can I make most of the ViewControllers only support a portrait orientation while only a couple supporting all orientations. I can't understand apples new auto rotate system. Also, how can I make this backwards compatable to iOS 5?

推荐答案

在您的 Navigation Controller 子类中,将决策转发到堆栈中的顶部视图控制器:

In your Navigation Controller subclass, forward the decision to the top view controller in the stack:

-(NSUInteger) supportedInterfaceOrientations {
   return [self.topViewController supportedInterfaceOrientations];
}

为此创建一个单独的故事板文件是最糟糕的做法,让它们与您的应用更新保持同步将是一场维护噩梦.

Creating a separate storyboard file for this is the worst path to follow, it'll be a maintenance nightmare to keep them in sync with your app updates.

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

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