2012-03-13 129 views
3

每一个Android应用程序/主题事呢它自己的基本主题颜色:更改基本主题颜色的Android应用程序的

HTC Desire Z的 - 绿色,

大部分三星deviced - 黄色,...

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

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

喜欢的东西:

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

//编辑:只有一个项目

所以我在寻找_DEFAULT_BASE_COLOR_1,在那里我可以设置单选按钮颜色的关键字,slected列表项。可能吗?

回答

-1

application标记您的清单定义为:

android:theme="@style/mytheme" 

现在在res /值,你可以定义一个文件说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> 
+0

这就是我已经有的:)我正在寻找正确的关键字'_DEFAULT_BASE_COLOR_1' – 2012-03-13 17:38:05

+0

所有这些基因集会有9个补丁的图像,而不是颜色定义。对于例如聚焦的编辑文本,您会在各种设备中看到橙/蓝色..不是颜色,但都是可绘制的....您必须修改它们中的每一个,例如编辑文本' ___ mystyle___' – 2012-03-14 04:40:36

+0

请将您的评论”您将不得不修改其中的每一个“,因为即使在”标准主题“中也有不同的可绘制,因此无法一次覆盖”默认“可绘制。 – 2012-03-14 04:53:33

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> 
+0

好吧,这就是我想要避免的(设置所有样式手册)。除此之外,风格不采取listViewStyle和radioButtonStyle :) – 2012-03-13 18:30:46

相关问题