AppDelegate window initialisation does not have correct size

倾然丶 夕夏残阳落幕 提交于 2020-01-15 10:44:07

问题


I have an app in Xcode which I want to start without a storyboard, so I created a new window in AppDelegate:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    let InitialViewController: SignViewController = SignViewController()
    let NavigationController: UINavigationController = UINavigationController(rootViewController: InitialViewController)

    self.window = UIWindow(frame: UIScreen.main.bounds)
    self.window!.rootViewController = NavigationController
    self.window!.makeKeyAndVisible()

    return true

}

The problem with this is that if I simulate it it returns a weird looking screen which seems to be to small on the y axis, and I don't know why:

Can anyone tell me what I need to change ?


回答1:


I hand the same problem like you did here. Check your info.plist. Did you delete the "Launch screen interface file base name"? If you did, add it back, and the problem would be solved.



来源:https://stackoverflow.com/questions/42440623/appdelegate-window-initialisation-does-not-have-correct-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!