问题
Every android application/theme hast it's own basic theme color:
HTC Desire Z - green,
most Samsung deviced - yellow,...
It's the color of selected list items, option menu-radio button, radio button, progress-bars,....
I know how to change these colors individual. But is there a way to change all of them by setting one value?
Something like:
<style name="my_theme" parent="@android:style/Theme.Black">
<item name="android:_DEFAULT_BASE_COLOR_1">#XXXXXX</item>
</style>
//EDIT:
So I'm looking for the keyword of _DEFAULT_BASE_COLOR_1, where I can set a color for radio button, slected list item with only one item. Is it possible?
回答1:
In your manifest in application
tag define as :
android:theme="@style/mytheme"
Now in res/values you can define a file say theme.xml with content as :
<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>
回答2:
try this:
<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>
来源:https://stackoverflow.com/questions/9688724/change-basic-theme-color-of-android-application