简体   繁体   English

黑色 iOS 启动屏幕而不是白色

[英]Black iOS launch screen instead of white

I have an issue with changing background color of launch screen on iOS.我在 iOS 上更改启动屏幕的背景颜色时遇到问题。 When I open the app for the first time it loads a white page before the black viewcontroller appears.当我第一次打开应用程序时,它会在黑色viewcontroller出现之前加载一个白色页面。 How can I change the white launch screen to a black one?如何将白色启动屏幕更改为黑色?

Below is my app General launch image settings:以下是我的应用程序常规启动图像设置:

在此处输入图像描述

I am still new with iOS.我还是 iOS 新手。 Any ideas?有任何想法吗?

Create a launch screen storyboard and select that as launch screen file.创建一个启动屏幕情节提要并选择它作为启动屏幕文件。

在此处输入图像描述

Then change the background to black.然后将背景更改为黑色。 You can also customize it whatever way you want你也可以随心所欲地定制它

在此处输入图像描述

There are many scenario about LaunchScreen turns into black.有很多关于 LaunchScreen 变黑的场景。

Here another scenario which I experienced it.这是我经历过的另一个场景。

If you set background color of LaunchScreen.storyboard from "New Color Set" from Assets.xcassets then it turns into back.如果您从Assets.xcassets“新颜色集”中设置 LaunchScreen.storyboard 的背景颜色,那么它会变回来。

Use SystemColor or Custom RBG Value to your LaunchScreen.storyboard Issue Fixed.将 SystemColor 或自定义 RBG 值用于您的LaunchScreen.storyboard问题已修复。

I had this problem before.我以前遇到过这个问题。 The default launch screen color is 'system background color' and it will be black when dark mode is enabled.默认启动屏幕颜色为“系统背景颜色”,启用暗模式时为黑色。 If you prefer to use white background color all the time, you can simply switch to white color in your panel.如果您喜欢一直使用白色背景颜色,您可以在面板中简单地切换为白色。

在此处输入图像描述

Actually, my case was on React Native, but it is no different for creating an iOS launch screen, the reason for the black screen was creating a storyboard file instead of Launch Screen , I have deleted my last file that I created and then try to create Launch Screen by the below option:实际上,我的案例是在 React Native 上,但是创建 iOS 启动屏幕并没有什么不同,黑屏的原因是创建storyboard文件而不是Launch Screen ,我删除了我创建的最后一个文件,然后尝试通过以下选项创建启动屏幕:

在此处输入图像描述

I don't know what was the main reason because in setting > general the launch screen setting was correct but still I was facing the black screen, I deleted and re-create everything by using the above image and it was fixed.我不知道主要原因是什么,因为在setting > general中启动屏幕设置是正确的,但我仍然面对黑屏,我使用上面的图像删除并重新创建了所有内容,并且已修复。

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

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