简体   繁体   English

查看不覆盖全屏(程序化 storyboard Swift)

[英]View not covering full screen (programmatic storyboard Swift)

In Xcode 11 initial window is configured now in SceneDelegate, here my code and result on picture:在 Xcode 11 初始 window 现在在 SceneDelegate 中配置,这里我的代码和图片上的结果:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

     print("Scene willConnectTo.")
       guard let windowScene = (scene as? UIWindowScene) else { return }

    //  window =  UIWindow(frame: windowScene.coordinateSpace.bounds)
    window =  self.window ?? UIWindow()
     let mainView = ViewController()
    mainView.title = "TEST"
     let navigationController = UINavigationController()
    navigationController.viewControllers = [mainView]
    window?.backgroundColor = .red 
    window?.windowScene = windowScene
    window?.rootViewController = navigationController
    window?.makeKeyAndVisible()
}

Can anyone suggest how to make view covering all screen?谁能建议如何使视图覆盖所有屏幕?

在此处输入图像描述

Make sure you have a LaunchScreen storyboard.确保您有 LaunchScreen storyboard。

It seems that its not possible to do LaunchScreen programmatically, as the screen will be loaded by the OS before the app launch itself, refer here似乎不可能以编程方式执行 LaunchScreen,因为屏幕将在应用程序启动之前由操作系统加载,请参阅此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM