gpt4 book ai didi

ios - 快速将一个特定的 View Controller 设置为横向模式

转载 作者:行者123 更新时间:2023-11-28 08:49:37 25 4
gpt4 key购买 nike

我们如何使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com