AppDelegate窗口初始化的大小不正确

编程入门 行业动态 更新时间:2024-10-26 03:35:18
本文介绍了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窗口初始化的大小不正确

本文发布于:2023-11-10 06:08:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574559.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:初始化   不正确   大小   窗口   AppDelegate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!