2
我在鎖定我的應用程序在橫向模式下掙扎。我只有一個ViewController,它不在NavigationController中。裏面的視圖控制器我有以下代碼:在Swift iOS9中鎖定橫向方向
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.LandscapeLeft
}
override func shouldAutorotate() -> Bool {
return false;
}
override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
return UIInterfaceOrientation.LandscapeLeft
}
在設置的「常規」選項卡我有以下幾點:
並在視圖控制器的屬性我有這樣的:
我在viewDidLoad中使用UIDevice.currentDevice()嘗試。的setValue(...)但那沒有效果。我試圖在iPad mini上運行這個應用程序,而且我完全無所適從。任何幫助將非常感激。
我試過這個,當我在iPad上運行應用程序時,它完美的工作。但是當我將檔案上傳到應用商店時,它說我需要iPad的所有方向。任何幫助將不勝感激。 – bhakti123
@ bhakti123,你有沒有得到這個解決? – GED125
不,這沒有解決我的問題。 – bhakti123