[英]Lock landscape orientation in Swift iOS9
我正在努力在橫向模式下鎖定我的應用程序。 我只有一個ViewController,它不在NavigationController中。 在視圖控制器內部,我有以下代碼:
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.LandscapeLeft
}
override func shouldAutorotate() -> Bool {
return false;
}
override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
return UIInterfaceOrientation.LandscapeLeft
}
在設置的“常規”選項卡中,我有以下內容:
在ViewController的屬性中我有這個:
我嘗試在ViewDidLoad中使用UIDevice.currentDevice()。setValue(...),但這沒有任何效果。 我試圖在iPad mini上運行這個應用程序,我完全不知所措。 任何幫助將非常感激。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.