gpt4 book ai didi

ios - Swift 3 - 如何锁定 iOS 应用程序的方向?

转载 作者:行者123 更新时间:2023-11-28 16:02:26 24 4
gpt4 key购买 nike

<分区>

我正在尝试创建一个仅支持纵向的应用程序,我已尝试在Target -> General -> Deployment Info -> Portrait 中进行设置

然后,在 appDelegate.swift

override func shouldAutorotate() -> Bool {
return false
}

AT ViewController.swift

    override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return [UIInterfaceOrientationMask.Portrait ]
}

但它不起作用.. 在 ViewController.swift 中,它给我错误:

Method does not override any method from its superclass

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