我正在尝试实现androidx.preference.PreferenceFragmentCompat,但遇到了这个奇怪的问题,尽管我的设置没有附加图标,但仍然为它们提供了空间。有什么问题吗?
编辑:pref.xml
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Settings Section 1">
<SwitchPreference
android:defaultValue="false"
android:key="switch_preference_1"
android:title="Title 1"
android:summary="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." />
<SwitchPreference
android:defaultValue="false"
android:key="switch_preference_1"
android:title="Title 2"
android:summary="Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat" />
<SwitchPreference
android:defaultValue="false"
android:key="switch_preference_1"
android:title="Title 3"
android:summary="Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur" />
<ListPreference
android:defaultValue="1"
android:entries="@array/pref_1_names"
android:entryValues="@array/pref_1_values"
android:key="switch_preference_2"
android:title="Title 4"
android:summary="Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum" />
</PreferenceCategory>
<PreferenceCategory
android:title="Setting Section 2">
<ListPreference
android:defaultValue="1"
android:entries="@array/pref_2_names"
android:entryValues="@array/pref_2_values"
android:key="switch_preference_2"
android:title="Title 5"
android:summary="Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo"
/>
</PreferenceCategory>
</PreferenceScreen>