Android 有没有一种方法可以让你的偏好更具风格

Android 有没有一种方法可以让你的偏好更具风格,android,android-styles,preferencefragment,Android,Android Styles,Preferencefragment,标题说明了一切:我如何设计我的偏好。我的v14/style.xml是 <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:editTextStyle">@style/Widget.EditText

标题说明了一切:我如何设计我的偏好。我的v14/style.xml是

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:editTextStyle">@style/Widget.EditText.White</item>
        <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
    </style>

    <style name="Widget.EditText.White" parent="@android:style/Widget.EditText">
        <item name="android:textColor">#ffffffff</item>
    </style>
</resources>

@style/Widget.EditText.White
@样式/首选项最低限度
#ffffffff
基本主题有一个黑色背景-首选项屏幕无法读取,因为我在黑色背景上有黑色文本

我试过很多方法,但我不能改变文本的颜色


我要做的是在设置片段处于活动状态时,将片段容器背景颜色设置为白色。一个丑陋的黑客,而不是我想要做的。

回答我自己的问题:我的v14/style.xml现在是

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:editTextStyle">@style/Widget.EditText.White</item>
        <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
    </style>

    <style name="Widget.EditText.White" parent="@android:style/Widget.EditText">
        <item name="android:textColor">#ffffffff</item>
    </style>

    <style name="PreferenceThemeOverlay.v14">
        <item name="android:background">@color/settings_background</item>
        <item name="android:textColor">@color/settings_text_colour</item>
        <item name="android:textColorSecondary">@color/settings_text_colour_secondary</item>
    </style>
</resources>

@style/Widget.EditText.White
@样式/首选项ThemeOverlay.v14.Material
#ffffffff
@颜色/设置\u背景
@颜色/设置\u文本\u颜色
@颜色/设置\u文本\u颜色\u辅助
我现在的问题是设置ListPreference的样式


为什么这么难?如果有任何与样式首选项相关的文档,那么它是隐藏的。Grrrrrr

看看github项目的自述文件

这可能会有所帮助:现在是2019年,即使使用preference material design v14支持库,首选项样式仍然不自然。与您的答案中类似的不推荐的解决方法终于可以解决了。。。我支持你的Grrrrrr!>:(现在是2020年,我可以找到完全零的方法来设置首选项的文本颜色(默认为黑色,我不使用)。还有一整天的时间。再次感谢Android。我是你的Grrrrr的第三名!>:-(