我见过这样的事情:
<PreferenceCategory xmlns:android="http://schemas.android.com/apk/res/android"
android:key="vegi_category" android:title="Vegetables"
android:summary="Preferences related to vegetable"> <!-- Why is this here? -->
<CheckBoxPreference android:key="tomato_selection_pref"
android:title="Tomato " android:summary="It's actually a fruit" />
<CheckBoxPreference android:key="potato_selection_pref"
android:title="Potato" android:summary="My favorite vegetable" />
</PreferenceCategory>
但我不明白为什么 pref 类别有一个汇总字段:
( android:summary="Preferences related to vegetable"
) ?
当我使用 pref screen 时,视图中会显示摘要,但这不是 pref 类别的情况。pref 类别中摘要的存在是否只是一种可以以某种方式看到的约定?
pref category 元素中 summary 的实际用法是什么?