iOS 应用程序- LaunchScreen.storyboard 在 ios 14.2 上显示为白色 [英] iOS App- LaunchScreen.storyboard displays white on ios 14.2

查看:45
本文介绍了iOS 应用程序- LaunchScreen.storyboard 在 ios 14.2 上显示为白色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Xcode 12.0.1 版.我已经在带有 ios 14 的模拟器上运行了该应用程序,启动屏幕工作正常,它显示了我想要显示的图像(启动画面),但是当我在具有 ios 14.2 的真实设备上运行该应用程序时,启动屏幕似乎是白色的.有人可以帮我提前谢谢.

I have Xcode version 12.0.1. I have run the app on simulator with ios 14, the launch screen working fine it shows the image I want to show(splash Screen), but when I run the app on real device which has ios 14.2 the launch screen just appeared to be white. can some one help me with this thanks in advance.

推荐答案

面临同样的问题.问题是启动屏幕故事板中使用的图像的大小.这导致整个启动屏幕只是黑色.

Faced the same problem. The issue was the size of the image used in the launch screen storyboard. This lead to the whole launch screen just being black.

解决方案 1:在我们的案例中修复它的是:

Solution 1: What fixed it in our case was:

  1. 选择较小尺寸的图片
  2. 从设备/模拟器中删除应用(有时需要)
  3. 重启设备/模拟器(有时需要)

主要原因是图像较大,因此只需将其替换为较小的图像即可.

解决方案 2:将启动画面图像放在 Images.xcassets 文件夹之外.(但这种方法的问题在于,如果您支持暗模式,则无法再为暗模式和亮模式设置不同的图像.)

Solution 2: Place your splash screen image outside the Images.xcassets folder. (But the issue with this approach is if you are supporting Dark Mode then it's not possible anymore to set a different image for dark and light mode.)

这篇关于iOS 应用程序- LaunchScreen.storyboard 在 ios 14.2 上显示为白色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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