问题
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