如何显示PreferenceScreen的摘要

时间:2012-07-12 14:28:46

标签: android

我想要一个带有标题和摘要的全屏PreferenceScreen。但是,当我提供摘要文本时,它不会显示:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
    android:title="My Title"
    android:summary="My Summary">
......

</PreferenceScreen>

1 个答案:

答案 0 :(得分:0)

在你拥有的地方添加....

<PreferenceCategory android:title="Title"
                    android:key="title_category_key">

    <PreferenceScreen
            android:key="my_title_key"
            android:title="Main Settings"
            android:persistent="false" >
    </PreferenceScreen>

        <EditTextPreference
                android:name="title"
                android:defaultValue="@string/title"
                android:title="title"
                android:key="title_key"
                android:editable="false"
                android:focusable="false"/>

 </PreferenceCategory>