強制橫屏

在新頁面的 viewDidLoad 中執行:ide

        UIDevice.currentDevice().setValue(UIInterfaceOrientation.LandscapeRight.rawValue, forKey: "orientation")函數


橫屏解決方案


將 SecondViewController 中的函數改成:spa


override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {orm

return UIInterfaceOrientationMask.Allit

}io

override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {margin

return UIInterfaceOrientation.LandscapeLefttop

}di

相關文章
相關標籤/搜索