我有一个首选项页面,我希望在“自定义抽认卡”首选项下有 3 个选项“缩进”或类似子类别。现在它们都在彼此之下,似乎它们适用于不同的设置。我如何使它看起来像“自定义抽认卡”偏好的子类别。这三个选项仅在选中自定义抽认卡时才启用。谢谢!
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
< PreferenceCategory
android:title="Flashcard Selection"
android:key="flashcard_selection">
<CheckBoxPreference
android:key="all_flashcards"
android:summary="Display All Flashcards"
android:title="All Flashcards"
android:defaultValue="true"
/>
<CheckBoxPreference
android:key="custom_flashcards"
android:summary="Display a customized list of flashcards"
android:title="Custom Flashcards"
android:defaultValue="false"/>
<CheckBoxPreference
android:key="red_flashcards"
android:dependency="custom_flashcards"
android:summary="Display Red Flashcards"
android:title="Red"
android:defaultValue="false"
/>
<CheckBoxPreference
android:key="yellow_flashcards"
android:summary="Display Yellow Flashcards"
android:title="Yellow"
android:defaultValue="false"
android:dependency="custom_flashcards"
/>
<CheckBoxPreference
android:key="green_flashcards"
android:summary="Display Green Flashcards"
android:title="Green"
android:defaultValue="false"
android:dependency="custom_flashcards"
/>
<ListPreference
android:key="frontside_preference"
android:summary="Choose what do you want on your front side"
android:title="Front side"
android:entries= "@array/Frontside_selection_array"
android:entryValues ="@array/Frontside_selection_values"
android:defaultValue="1"
/>
</PreferenceCategory>
</PreferenceScreen>