且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的全息选择的列表项的颜色

更新时间:2023-12-04 21:45:52

如果你看一下Android的平台框架的基础上,尤其是的themes.xml 文件,你会找到回答你的问题:

If you have a look at Android's platform framework base, especially the themes.xml file, you will find the answer to your question:

https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/themes.xml

这个文件定义,除其他外,以下两个河洛主题和相应的项目:

This file defines, amongst others, the following two Holo themes and its corresponding items:

Theme.Holo:

<style name="Theme.Holo">
    ...
    <item name="colorPressedHighlight">@color/holo_blue_light</item>
    <item name="colorLongPressedHighlight">@color/holo_blue_bright</item>
    ...
</style>

Theme.Holo.Light:

<style name="Theme.Holo.Light" parent="Theme.Light">
    ...
    <item name="colorPressedHighlight">@color/holo_blue_light</item>
    <item name="colorLongPressedHighlight">@color/holo_blue_bright</item>
    ...
</style>

我觉得这是两个颜色,你正在寻找。
这些颜色被翻译成以下的十六进制codeS:

I think these are the two colours you are looking for.
The colours are translated into the following hex codes:

<!-- A light Holo shade of blue -->
<color name="holo_blue_light">#ff33b5e5</color>

<!-- A really bright Holo shade of blue -->
<color name="holo_blue_bright">#ff00ddff</color>