【问题标题】:Use a different launch screen for the first launch of an app首次启动应用时使用不同的启动屏幕
【发布时间】:2019-09-24 02:55:18
【问题描述】:

我当前的启动屏幕与您在应用加载时看到的完全一样(Apple 推荐)。但是,当用户第一次启动应用程序时,会在启动屏幕后立即播放视频 - 两者完全不同。

有没有办法更改应用首次启动时的启动屏幕?

【问题讨论】:

    标签: swift xcode load launch launch-screen


    【解决方案1】:

    您显然可以通过将 rootViewController 更改为 AppDelegate 来更改应用程序的初始启动

    将这些代码行放在你的 AppDelegate 中

    var window: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.backgroundColor = .white
        window?.makeKeyAndVisible()
    
        let mainViewController = YourMainViewController()
        window?.rootViewController = mainViewController
    
        return true
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-04
      • 1970-01-01
      • 2021-05-06
      • 1970-01-01
      • 2020-09-20
      相关资源
      最近更新 更多