iphone - 我无法理解iOS6中的旋转机制

标签 iphone rotation ios6

我的应用程序具有子类化shouldautorotateToInterfaceOrientation的 View Controller 。在其中,我决定每个 View 的旋转。这工作正常。但在iOS6中,虽然看了Apple提供的文档,但看不懂。

我的应用程序将导航 Controller 作为 Root View Controller 。该导航 Controller 有选项卡 Controller 。选项卡 Controller 有一些 View Controller 。我希望第一个 View Controller (在选项卡 Controller 中)仅以纵向模式查看,第二个 View Controller (在选项卡 Controller 中)同时以纵向和横向模式查看。在iOS5下可以正常运行。 但我不知道如何在iOS6中实现。虽然我知道我应该子类 supportedInterfaceOrientations,但当旋转发生时它不起作用。令我惊讶的是,当 View 显示时它就会被调用。 如何做出我想要的东西?

感谢您的阅读。

最佳答案

以下链接可能会引导您走向正确的方向:http://code.shabz.co/post/32051014482/ios-6-supportedorientations-with-uinavigationcontroller

基本上,您需要子类化 UINavigationController 并让它监听其 topViewController-supportedInterfaceOrientations 中的更改。您可以在博客文章中下载一个示例类,并且还解释了要添加的代码。

关于iphone - 我无法理解iOS6中的旋转机制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12669250/

相关文章:

ios - Facebook iOS SDK 3.1.1 安装问题

iphone - Xcode 4.6 失败,退出代码为 255

javascript - 在fabricjs中旋转整个 Canvas

python - 无损 PDF 旋转

java - 检测 360 度转弯算法

ios - 如何插入与另一个相关的核心数据记录?

iPhone:创建 MKAnnotation

iphone - 在 UITableViewCell 中启用/禁用编辑模式

iPhone:应用程序商店中的应用程序名称和 bundle 名称必须相似吗?

ios - 向 UIView 添加渐变的现代技术