iphone - 某些 View 的 Xcode iphone 方向支持

标签 iphone ios xcode ipad

除了主视图 Controller 之外,我想支持所有 View 的所有方向。我似乎找不到办法做到这一点。

我可以支持所有 View 的方向,也可以在整个应用程序中不支持任何 View 。您如何支持整个应用中某些 View 的方向?

最佳答案

我还没有使用过需要按照您描述的方式运行的应用程序,但以下是 Apple 文档在您需要控制方向支持时的建议:

Dynamically Controlling Whether Rotation Occurs

Sometimes you may want to dynamically disable automatic rotation. For example, you might do this when you want to suppress rotation completely for a short period of time. You must temporarily disable orientation changes you want to manually control the position of the status bar (such as when you call the setStatusBarOrientation:animated: method).

> If you want to temporarily disable automatic rotation, avoid manipulating the orientation masks to do this. Instead, override the shouldAutorotate method on the topmost view controller. This method is called before performing any autorotation. If it returns NO, then the rotation is suppressed.

来源:http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/RespondingtoDeviceOrientationChanges/RespondingtoDeviceOrientationChanges.html#//apple_ref/doc/uid/TP40007457-CH7-SW1

关于iphone - 某些 View 的 Xcode iphone 方向支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13446633/

相关文章:

ios - 如果用户以编程方式点击 UITextfield,如何显示 UIDatePicker

ios - UITableViewCell内部的动态高度收集/标签 View

ios - 无法以编程方式设置 UINavigationControllerDelegate(但可以通过 Storyboard设置)

android - WebApp ajax 不加载 jQueryMobile

ios - 是否可以在没有任何互联网连接/禁用蜂窝网络的情况下使用核心定位/GPS?

ios - 如何在 Flutter 中读取已使用 iOS 中的 NSKeyedArchiver 写入文件系统的文件作为字符串?

c++ - xcode\377 倒置 '?'

iphone - 在 iOS 设备上而不是在模拟器上运行时出现 SIGABRT 错误

iphone - 有人试过在 iPhone 3G 上安装 iOS 4.3 吗?

iphone - 如何使用 Objective-C 动态调整方法名称和调用