Style for PrefenceScreen
I'd like to be able开发者_如何学C to customize the view of a PreferenceScreen
, and so I'm interested in knowing how to set a style for it.
I wouldn't recommend it but you can start extending all the preference's classes (DialogPreference
, CheckboxPreference
, etc) and create your own widgets with the style you want.
Try this for increasing font size in onResume():
Window window = getActivity().getWindow();
window.getContext().setTheme(R.style.PreferencesTheme);
and create a style PreferencesTheme in layout/styles.xml file:
<style name="PreferencesTheme">
<item name="android:textColor">#000000</item>
<item name="android:windowNoTitle">true</item>
<item name="android:textSize">40sp</item>
<item name="android:paddingLeft">0sp</item>
<item name="android:colorBackground">#0000ff</item>
</style>
精彩评论