iOS 6 auto rotate confusion(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 自动旋转混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS 6 自动旋转混乱
基础教程推荐
- Android Volley - 如何动画图像加载? 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
