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