简体   繁体   中英

It there any analog of level-list for colors on Android?

I am trying to find a way to give a user the possibility to switch between different color schemes (that includes different colors and images). All schemes are predifined, ie compiled and located inside the app. As I can see, for drawables I can do this by using level-list where each level corresponds to one scheme. But what about colors? Is there any way to do the same for colors? Or maybe there is a better way to implement color schemes switching?

您可以使用样式和主题的内置机制

尝试使用可以使用getResources().getColorStateList(id)检索的ColorStateList.getColorStateList getResources().getColorStateList(id)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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