内preferenceScreen文字大小 [英] Text size within an PreferenceScreen
问题描述
我有一个定义,如下面的例子一些preference屏幕xml文件
I have xml file that defines some preference screens like the following example
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="root_preferencescreen">
<PreferenceScreen android:key="general_sett" android:title="general settings" />
....
<PreferenceScreen android:key="extras_sett" android:title="extras settings" />
</PreferenceScreen>
我希望能够增加字体大小为preference屏幕的文本,但由于内preference屏幕没有安卓TEXTSIZE标签,我不知道如何做到这一点!
I would like to be able to increase the font size for the text of the preference screen , but because the within a preference screen there is no android:textsize tag , i have no idea how to accomplish that !
推荐答案
您可以让一个TextView布局XML看起来是这样的:
You can make a TextView layout xml that looks something like this:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/listSeparatorTextViewStyle"
android:textColor="@android:color/white"
android:id="@+android:id/title"
/>
和设置您的preference类别布局在preferences.xml是这样的:
and set the layout of your preference category in your preferences.xml like this:
<PreferenceCategory
android:title="Category Title"
android:layout="@layout/pref_category"
/>
只要TextView的ID为@ +安卓ID /标题可以使版面看起来不过你想要的。还有一种方式与风格,我还没有完全想通了,做到这一点。
As long as the TextView has the id @+android:id/title you can make the layout look however you want. There is also a way to do this with styles that I haven't quite figured out.
这篇关于内preferenceScreen文字大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!