【发布时间】:2021-09-17 13:20:55
【问题描述】:
我有一个情节提要文件,我想将其用作初始屏幕。我已将该情节提要中的 ViewController 设置为初始视图。
我也这样设置启动屏幕:
这是我在SceneDelegate 中的代码,用于选择第一个 ViewController 来向用户显示:
self.window = UIWindow(frame: UIScreen.main.bounds)
let vc = storyboard.instantiateViewController (withIdentifier: "Channels") as! UINavigationController
window = UIWindow(windowScene: windowScene)
window?.rootViewController = vc
window?.makeKeyAndVisible()
我在第一次启动应用程序时看到启动画面,然后是黑屏;最后是我的用户界面。
【问题讨论】:
-
UINavigationController是视图控制器吗? -
我很惊讶你的应用没有崩溃。
-
黑屏可能是你显示的代码造成的。尝试删除它。
-
另外请注意,启动屏幕不是启动屏幕。
-
我在您的代码中没有看到问题。
标签: ios swift storyboard splash-screen uiscenedelegate