我创建了一个自定义样式
<style name="PrivatStyle" parent="Theme.Sherlock">
<item name="android:textColor">@color/default_text_color</item>
<item name="android:textAppearance">@style/MyTextAppearance</item>
<item name="android:buttonStyle">@style/MyButtonStyle</item>
<item name="android:editTextStyle">@style/MyEditTextStyle</item>
<item name="android:imageButtonStyle">@style/MyImageButtonStyle</item>
<item name="android:textViewStyle">@style/MyTextViewStyle</item>
<item name="android:expandableListViewStyle">@style/MyExpandableListViewStyle</item>
<item name="android:listViewStyle">@style/MyListViewStyle</item>
</style>
<style name="MyTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyButtonStyle" parent="@android:style/Widget.Button">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyEditTextStyle" parent="@android:style/Widget.EditText">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyExpandableListViewStyle" parent="@android:style/Widget.ExpandableListView">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyListViewStyle" parent="@android:style/Widget.ListView">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyImageButtonStyle" parent="@android:style/Widget.ImageButton">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyTextViewStyle" parent="@android:style/Widget.TextView">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="PrivatStyle" parent="Theme.Sherlock">
<item name="android:textColor">@color/default_text_color</item>
<item name="android:textAppearance">@style/MyTextAppearance</item>
<item name="android:buttonStyle">@style/MyButtonStyle</item>
<item name="android:editTextStyle">@style/MyEditTextStyle</item>
<item name="android:imageButtonStyle">@style/MyImageButtonStyle</item>
<item name="android:textViewStyle">@style/MyTextViewStyle</item>
<item name="android:expandableListViewStyle">@style/MyExpandableListViewStyle</item>
<item name="android:listViewStyle">@style/MyListViewStyle</item>
</style>
<style name="MyTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyButtonStyle" parent="@android:style/Widget.Button">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyEditTextStyle" parent="@android:style/Widget.EditText">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyExpandableListViewStyle" parent="@android:style/Widget.ExpandableListView">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyListViewStyle" parent="@android:style/Widget.ListView">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyImageButtonStyle" parent="@android:style/Widget.ImageButton">
<item name="android:textColor">@color/default_text_color</item>
</style>
<style name="MyTextViewStyle" parent="@android:style/Widget.TextView">
<item name="android:textColor">@color/default_text_color</item>
</style>
在所有活动的清单样式中都设置为此
它适用于TextView,Button,ListView,EditText,但不适用于ExpandableListView。
ExpandableListView是来自gropup.xml和child.xml的自定义布局。
如果在gropup.xml和child.xml中设置样式 - 一切正常。