AppDelegate 窗口初始化没有正确的大小 [英] AppDelegate window initialisation does not have correct size

查看:15
本文介绍了AppDelegate 窗口初始化没有正确的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Xcode 中有一个应用程序,我想在没有故事板的情况下启动它,所以我在 AppDelegate 中创建了一个新窗口:

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

}

这个问题是,如果我模拟它,它会返回一个看起来很奇怪的屏幕,在 y 轴上似乎很小,我不知道为什么:

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 ?

推荐答案

我处理的问题和你在这里处理的一样.检查您的 info.plist.您是否删除了启动屏幕界面文件基本名称"?如果你这样做了,把它加回来,问题就解决了.

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.

这篇关于AppDelegate 窗口初始化没有正确的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆