1

I am trying to implement androidx.preference.PreferenceFragmentCompat, but I get this weird issue, event though my settings do not have icons attached to them, It still renders space for them. What can be wrong?

enter image description here

Edit: 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>
4

0 回答 0