简体   繁体   English

快速在暗模式下遇到自定义颜色问题

[英]having issues regarding custom colors in dark mode in swift

I am updating my applications according to dark mode in iOS 13 .我正在根据iOS 13暗模式更新我的应用程序。 I have used custom colors in my applications which works fine on light mode.我在我的应用程序中使用了自定义颜色,在光照模式下效果很好。 But when it came to dark mode it didn't work.但是当谈到黑暗模式时,它不起作用。 I am looking for some of code or line of code which helps me to use my already used custom colors in dark mode.我正在寻找一些代码或代码行,以帮助我在暗模式下使用我已经使用过的自定义颜色。 I have no idea how to do that.我不知道该怎么做。 Need help.需要帮忙。

Thanks in advance..!!提前致谢..!!

You should use colors from the assets !您应该使用assets颜色! As you are adding images likewise you can add color set in the Assets .同样,当您添加图像时,您可以在Assets添加颜色集。 From the Attribute inspector , you can change appearances to Any, Dark or Any, Light, Dark and set color for each.Attribute inspector ,您可以将外观更改为Any, DarkAny, Light, Dark并为每个设置颜色。 Refer below screenshot for better understanding.请参阅下面的屏幕截图以更好地理解。

在此处输入图片说明

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

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