我有一个 iOS 10 通用应用程序(同时支持 iPad 和 iPhone)。在应用程序 .plist 中,我指定该应用程序支持纵向和横向模式。现在我想将单个 UIViewController 限制为仅纵向模式。该 View Controller 由呈现其他 View Controller 的同一导航 Controller 呈现。在 iOS 10 中将单个特定 View Controller 限制为纵向的最佳(最简单)方法是什么。(请注意,有很多已发布的解决方案,但据我所知,这个问题的答案对于不同的版本是不同的iOS。我只需要一个支持 iOS 10 的解决方案。)
最佳答案
Now I would like to restrict a single UIViewController to portrait only mode. That view controller is presented by the same navigation controller that presents other view controllers
在 iOS 10 中,没有支持的方式来执行您所描述的操作。导航 Controller 不能使其某些子项处于一个方向而其他子项处于另一个方向。
让 View Controller 强制不同方向的唯一受支持方法是使其成为呈现 View Controller (模态),不是导航中的推送 View Controller Controller 堆栈。
关于ios - 如何将 iOS 10 通用应用程序中的单个 UIViewController 限制为纵向布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40960637/