Worse, if you forget to unregister the notifications, your app may crash. But then how do we deal with views that have already been initialized? Yes, we could use notifications to change their colors or image cuts, but this leads to controllers unnecessarily full of notification register/unregister, if.else and UI updating code. So how do we achieve this? Maybe we can set a global variable that represents the currently selected theme, and use different background colors or image cuts based on the variable during the controller's initialization. More accurately, "night mode" is a theme/skinning feature that can switch between bright theme and dark themes. It's not as simple as just changing brightness or alpha on the top-level view-in fact, it needs an entirely new interface: different colors, different alpha, different image cuts. SwiftTheme - □ Powerful theme/skin manager for iOS 8+ 主题/换肤, 暗色模式Īs part of our project requirement, we need to add night mode to our app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |