iOS 6 自动旋转混乱

iOS 6 auto rotate confusion(iOS 6 自动旋转混乱)
本文介绍了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 自动旋转混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)
Android IllegalArgumentException: The tag for fragment_XXX is invalid. Received: layout-sw600dp/fragment_XXX_0(Android IlLegalArgumentException:Fragment_XXX的标签无效。收到:Layout-sw600dp/Fragment_XXX_0)
iOS convert audio sample rate from 16 kHz to 8 kHz(IOS将音频采样率从16 kHz转换为8 kHz)
Enforcing an audio sampling rate in iOS(在iOS中强制音频采样率)
Question about the rotation of X axis on Android(关于Android上X轴旋转的问题)