简体   繁体   English

iOS swift 应用程序启动时的黑屏

[英]Black Screen at the start of iOS swift app

i have a problem.我有个问题。 when i launch my app there is a black screen viewed for a seconds then the launch screen appeared.当我启动我的应用程序时,会看到一个黑屏,然后出现了启动屏幕。

my splash screen isn't the default one.我的启动画面不是默认的。 i used view controller because my splash had an animation.我使用视图控制器是因为我的飞溅有动画。

i searched for a solution, and i get this on:我搜索了一个解决方案,我得到了这个:

Black screen before my splash screen loads iphone 在我的启动画面加载 iphone 之前黑屏

but it didn't worked但它没有用

any help please?有什么帮助吗?

thanks谢谢

Have you selected your Launch Screen in your target's App Icons and Launch Images ?您是否在目标的App Icons and Launch Images选择了启动屏幕?

Edit: If you don't use any launch (splash) screen or image then, a black screen is the default behaviour before loading your view controller.编辑:如果您不使用任何启动(启动)屏幕或图像,那么在加载视图控制器之前,黑屏是默认行为。

在此处输入图片说明

I faced same issue but my solution is different, I've made an extension of UINavigationController to make UINavigationBar clear.我遇到了同样的问题,但我的解决方案不同,我对UINavigationController进行了扩展以使UINavigationBar清晰。 So,the problem is , I was doing some R&D on that code and unknowingly put a method所以,问题是,我正在对该代码进行一些研发,并在不知不觉中放置了一个方法

open override func loadView() {
        super.loadView()

    }

and from that time, I started facing this issue.从那时起,我开始面临这个问题。

My advice, please double check that you haven't don't something like that.我的建议,请仔细检查您是否没有那样的东西。

I had a custom splash screen to launch.我有一个自定义启动画面要启动。 But the Launch Screen file was pointed to Default LaunchScreen.storyboard .但是 Launch Screen 文件指向 Default LaunchScreen.storyboard Replaced that with my original custom splash, the issue fixed用我原来的自定义飞溅替换它,问题解决了

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM