更改android应用程序的基本主题颜色

时间:2012-03-13 17:10:25

标签: android android-layout

每个Android应用程序/主题都有自己的基本主题颜色:

HTC Desire Z - 绿色,

大多数三星设备 - 黄色,......

这是所选列表项的颜色,选项菜单 - 单选按钮,单选按钮,进度条,....

我知道如何改变这些颜色。但有没有办法通过设置一个值来改变所有这些?

类似的东西:

<style name="my_theme" parent="@android:style/Theme.Black">
      <item name="android:_DEFAULT_BASE_COLOR_1">#XXXXXX</item>
</style>

//编辑:

所以我正在寻找_DEFAULT_BASE_COLOR_1的关键字,我可以设置单选按钮的颜色,只选择一个项目的选择列表项。有可能吗?

2 个答案:

答案 0 :(得分:1)

application标记的清单中,定义为:

    android:theme="@style/mytheme"

现在在res / values中,您可以定义一个文件,例如theme.xml,内容为:

<resources> 
    <style name="mytheme" parent="@android:style/Theme" > 
       <item name="android:_DEFAULT_BASE_COLOR_1">#XXXXXX</item>
       <item name="android:windowNoTitle">true</item>
        ... . 
    </style>
</resources>

答案 1 :(得分:0)

试试这个:

    <style name="my_theme" parent="@android:style/Theme.Black">
        <item name="listChoiceIndicatorSingle">xxxxxxx</item>
<item name="radioButtonStyle">xxxxxxx</item>
<item name="listChoiceBackgroundIndicator">xxxxxxx</item>
<item name="listViewStyle">xxxxxxx</item>
<item name="listDivider">xxxxxxx</item>
<item name="listSeparatorTextViewStyle">xxxxxxx</item>
    ....
    </style>
相关问题