如何进行设置以更改应用中所有文字的字体大小。
我的偏好xml是
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:defaultValue="true"
android:key="check box"
android:summary="Screen stays on yes/no "
android:title="Display stays on"
/>
<ListPreference
android:title="Font Size"
android:key="Fontsize"
android:entries="@array/listarray"
android:entryValues="@array/listvalues"
android:defaultValue="3"
/>
和数组
<string-array name="listarray">
<item>Very Small</item>
<item>Small</item>
<item>Medium</item>
<item>Large</item>
<item>XLarge</item>
</string-array>
<string-array name="listvalues">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
和preference.java
public class preference extends PreferenceActivity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(android.R.id.content, new preferencefrag()).commit();
}
public static class preferencefrag extends PreferenceFragment {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference);
我想通过列表首选项
更改应用程序布局中所有文本的大小