我怎样才能改变preferenceScreen字体大小 [英] How can I change font size in PreferenceScreen

查看:1797
本文介绍了我怎样才能改变preferenceScreen字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
    <PreferenceCategory
        android:title="First Category"
        android:textSize="20px">

        <CheckBoxPreference
            android:title="Checkbox Preference"
            android:defaultValue="false"
            android:summary="This preference can be true or false"
            android:key="checkboxPref" />

    </PreferenceCategory>
</PreferenceScreen>

我需要改变安卓标题字体 prefereceCategory 尺寸复选框preference 安卓总结尺寸。这些标签没有任何安卓TEXTSIZE 属性。任何一个可以帮助我如何得到这个?

I need to change android:title font size of PrefereceCategory, CheckboxPreference and android:summary size. These tags don't have any android:textSize attribute. Can any one help me how to get this?

推荐答案

最后我能够简单地通过一门布局,以解决我的问题。也许这将是有帮助的人。 这是我修改preference.xml见下文code。我们可以运用我们自己的属性,以$ P $粉煤标题和摘要。

Finally I was able to solve my problem simply by passing one layout. Maybe this will be helpful to someone. This is my modified preference.xml see below code. We can apply our own properties to pref title and summary.

preference.xml:

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
    <PreferenceCategory
        android:title="First Category"
        android:textSize="20px"
        android:layout="@layout/mylayout">             

        <CheckBoxPreference
            android:title="Checkbox Preference"
            android:defaultValue="false"
            android:summary="This preference can be true or false"
            android:key="checkboxPref"
            android:layout="@layout/mylayout"/>

    </PreferenceCategory>
</PreferenceScreen>

mylayout.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <TextView android:id="@+android:id/title"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:textSize="40px"/>  

    <TextView android:id="@+android:id/summary"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:textSize="26px"/>

</LinearLayout>

请问我,如果有任何疑问....保持微笑。如果这是有益的给我一个评论。

Please ask me if any queries....Keep Smiling. If this is useful give me one comment.

这篇关于我怎样才能改变preferenceScreen字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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