[英]Launch Images for Dark or Light Mode
有谁知道我如何为暗模式或亮模式选择一组不同的启动图像?
As the Launch Screen loads before the app starts executing, it would not be possible to change the launch images set programatically.由于启动屏幕在应用程序开始执行之前加载,因此无法以编程方式更改启动图像设置。
However, in the Image Set
tab, you can change the Appearance
option to enable a different set of images for Light and Dark modes:但是,在“
Image Set
选项卡中,您可以更改“ Appearance
选项以启用不同的明暗模式图像集:
So, if you set this image in the Launch Screen Storyboard, the result would be as below:因此,如果您在 Launch Screen Storyboard 中设置此图像,结果将如下所示:
On a side note, if the need is just to change the background color, not the images, you may set the Launch Screen Storyboard view background color to System Background Color
and just use transparent .png images.附带说明一下,如果只需要更改背景颜色,而不是图像,您可以将 Launch Screen Storyboard 视图背景颜色设置为
System Background Color
并仅使用透明的 .png 图像。
This WWDC'19 session gives an introduction to Dark Mode, the principles behind it, and tips on how to add support for it in an app. 这个WWDC'19 会议介绍了暗模式,它背后的原理,以及如何在应用程序中添加对它的支持的提示。
If you start somewhere at 10:10, you'll get an idea of how to implement launch images for dark and light mode. 如果你从10:10开始某个地方,你就会知道如何为暗和亮模式实现启动图像。
You should do something like this to use light and dark mode images你应该做这样的事情来使用明暗模式的图像
Step 1 - Create image set in assets.xassets like this第 1 步 - 在 assets.xassets 中像这样创建图像集
Step 2 - Select Image select like this第 2 步 - 像这样选择图像选择
仅就我的经验而言,有时当您擦除应用程序、关闭设备并再次打开时,启动图像会发生变化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.