除了主视图 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.
关于iphone - 某些 View 的 Xcode iphone 方向支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13446633/