我们如何使用 xib 在 swift 中将一个特定的 View Controller 设置为横向模式?
func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
let orientation: UIInterfaceOrientationMask =
[UIInterfaceOrientationMask.Portrait, UIInterfaceOrientationMask.PortraitUpsideDown]
return orientation
}
我正在使用上面的代码,但它似乎不起作用..
最佳答案
我很确定您不能通过使用 Storyboard 来针对每个 View Controller 。如果您按原样在代码中执行此操作,则需要为该函数指定 override 关键字。您还需要确保您的应用项目支持您希望为任何特定 View Controller 支持的所有界面方向。
关于ios - 快速将一个特定的 View Controller 设置为横向模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34543912/