我的应用程序以纵向模式运行,但我只想在横向模式下显示一个屏幕,因为它是一张图表。我应该向我的 uiviewcontroller 添加什么以强制它仅进入横向模式?
最佳答案
很抱歉,这个答案会很简短:如果您使用的是 UINavigationController,则不能。因此@jer 给出的答案是不正确的。 Apple 文档指出:
All child view controllers in your UITabBarController or UINavigationController do not agree on a common orientation set.
我最近在悬赏中回答了这个问题,但我的应用程序在此过程中被拒绝了。在这里阅读:How to constrain autorotation to a single orientation for some views, while allowing all orientations on others?
你唯一的解决办法是扔掉 UINavigationController 并用你自己的东西重写它。
关于iphone - 强制 UIViewController 仅在横向模式下显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5339662/