简体   繁体   English

android样式和主题-如何获取主色

[英]android styles and themes - how to get main theme color

I created my own style which I use as theme for my app. 我创建了自己的样式,将其用作应用程序的主题。 It's based on android default holo light with some modification. 它基于android默认的holo light进行了一些修改。 As main color I use everywhere @android:color/holo_blue_light It worked ok with older versions of Android but when I got Android 4.2.2 device I noticed that it's possible to change the theme in device settings to ex. 作为主要颜色,我到处都使用@android:color/holo_blue_light在旧版本的Android上可以正常工作,但是当我获得Android 4.2.2设备时,我注意到可以将设备设置中的主题更改为ex。 Mint. 薄荷。 Then part of my app interface is in mint color (the things I didn't changed in default holo light theme) and part is in holo_blue_light. 然后,我的应用程序界面的一部分为薄荷色(在默认的holo light主题中我没有更改的内容),另一部分为holo_blue_light。

The question is how to modify my style, instead of using @android:color/holo_blue_light to have main theme color (which in some cases will be blue light but in some cases ex. mint) (what label to use to get main theme color?). 问题是如何修改我的样式,而不是使用@android:color/holo_blue_light来具有主主题颜色(在某些情况下将是蓝色,但在某些情况下将是薄荷)(用于获取主主题颜色的标签) ?)。

Thanks for help. 感谢帮助。

是的,此链接可能对您更改主题颜色甚至更改操作栏跟随很有帮助。

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

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