gpt4 book ai didi

ios - UserInterfaceStyle Light 不适用于发布版本

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

我通过在 plist 文件中设置 User Interface Style = Light 强制我的应用程序处于 Light 模式。

但是,它似乎只在我以 Debug模式运行应用程序时有效(插入电缆并运行)。当我存档 ipa 并分发到 TestFlight 时,它不起作用。有人有同样的问题吗?

请注意,状态栏、操作表、警报 View 是受影响的控件。

任何帮助将不胜感激。谢谢。

最佳答案

您需要在 Appdelegate 中进行设置。我在我所有的应用程序中都使用它并且它正在运行。

if #available(iOS 13.0, *) {
window?.overrideUserInterfaceStyle = .light
}

对于 iOS 13 及更高版本,将其添加到 SceneDelegate 中。

 @available(iOS 13.0, *)
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
window?.overrideUserInterfaceStyle = .light
}

关于ios - UserInterfaceStyle Light 不适用于发布版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58428779/

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