更新时间:2023-12-04 19:38:46
以下是添加颜色逻辑的代码,该代码应在黑暗模式下出现.
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