我有一个应用程序,它由一个包含 4 个导航 Controller 的标签栏 Controller 组成。我找不到任何解决方案让导航 Controller 层次结构中的一个 Controller 仅处于横向模式。所有其他 Controller 都应该是纵向的。感谢在此问题上的任何帮助。
最佳答案
在你想要横屏的导航 Controller 的viewDidLoad():
中,包含:
let value = UIInterfaceOrientation.LandscapeLeft.rawValue
UIDevice.currentDevice().setValue(value, forKey: "orientation")
一定要添加以下重写
override func shouldAutorotate() -> Bool {
return true
}
关于ios - 一个横向 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33374029/