I change color PreferenceScreen with this code.But how get Preference Screen in main Preference activity and change Preference Screen color ???
getListView().setBackgroundColor(Color.TRANSPARENT);
getListView().setCacheColorHint(Color.TRANSPARENT);
getListView().setBackgroundColor(Color.rgb(4, 26, 55));
You can override OnCreate Method:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
view.setBackgroundColor(getResources().getColor(<COLOR>));
return view;
}
Or you can enter the following in styles.xml
<style name="PreferenceTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<item name="android:background">@android:color/white</item>
</style>
Just extend AppTheme and use colorBackground attribute
<style name="PreferenceTheme" parent="@style/AppTheme">
<item name="android:colorBackground">@color/colorBackground</item>
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With