内preferenceScreen文字​​大小 [英] Text size within an PreferenceScreen

查看:80
本文介绍了内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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆