我们如何在当前使用iOS 13的iOS应用中支持暗模式? [英] How we Support Dark Mode in Current iOS App with iOS 13?
本文介绍了我们如何在当前使用iOS 13的iOS应用中支持暗模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我当前的应用程序都是在objC和Swift中开发的.我需要支持暗模式.有人可以建议我如何在全球范围内实现这一目标吗?
My current app is developed in objC and Swift both. i need to support a darkmode. can anyone suggest how can i achieve this by globally?
推荐答案
以下是添加颜色逻辑的代码,该代码应在黑暗模式下出现.
Here is the code for adding your color logic should appear in the dark mode.
if self.traitCollection.userInterfaceStyle == .dark {
//Add your Dark mode colors here
} else {
//Your normal colors should appear here
}
要了解有关在iOS应用程序中适应暗模式的更多信息,请参阅以下博客文章.
To know more about adapting dark mode in your iOS application please refer to the following blog post.
How to Adopt iOS 13 Dark Mode in your iOS App
这篇关于我们如何在当前使用iOS 13的iOS应用中支持暗模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文