样式.xml
<style name="SettingsTheme" parent="android:Theme.Light">
<!-- Override properties according to your need -->
<item name="android:colorBackground">#ffffff</item>
<item name="android:colorForeground">#aaaaaa</item>
<item name="android:textColorPrimary">#ff0000</item>
<item name="android:textColorSecondary">#0000ff</item>
<item name="android:textColorTertiary">#00ff00</item>
<item name="android:textColorPrimaryDisableOnly">#888888</item>
<item name="android:textColorHint">#778899</item>
</style>
AndroidManifest.xml
在使用中将新定义的样式应用于 Preference Activityandroid:theme
<activity android:name=".SettingsThemeActivity"
android:label="@string/app_name"
android:theme="@style/SettingsTheme">
编辑:尝试设置主题之前
setTheme(R.style.SettingsTheme);
setContentView(R.layout.main);