我正在努力在横向模式下锁定我的应用程序.我只有一个ViewController,它不在NavigationController中.在视图控制器内部,我有以下代码:
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.LandscapeLeft
}
override func shouldAutorotate() -> Bool {
return false;
}
override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
return UIInterfaceOrientation.LandscapeLeft
}
Run Code Online (Sandbox Code Playgroud)
在设置的"常规"选项卡中,我有以下内容:
在ViewController的属性中我有这个:
我尝试在ViewDidLoad中使用UIDevice.currentDevice().setValue(...),但这没有任何效果.我试图在iPad mini上运行这个应用程序,我完全不知所措.任何帮助将非常感激.