Android preference category background color

I am trying to adjust the background color of preference categories. I already changed the background of the settings themselves, but I can’t find a way to change the background color of the categories.

I found two ways, but they do not work for me: changing the label color of the preference category label

Through this link I found this one , but nothing works for me, This is what I have done yet:

<resources>
    <style name="setBackgroundTheme" parent="android:Theme">
        <item name="android:background">@color/darkbluelogo</item>
    </style>
</resources>

In onCreate, I set the topic using

setTheme(R.style.setBackgroundTheme);
+3
source share
1 answer

Customize the layout file with the background color, set it in your PreferenceCategory:

<PreferenceCategory
    android:layout="@layout/your_layout">
+7
source

All Articles