本文介绍了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窗口初始化的大小不正确
发布评论