The answers here didn't work for me. However, this one did:
source: https://stackoverflow.com/a/53402144/9026710
In your PreferenceScreen add this line:
xmlns:app="http://schemas.android.com/apk/res-auto"
add this line in PreferenceScreen and it's elements:
app:iconSpaceReserved="false"
Example:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
app:iconSpaceReserved="false"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
app:iconSpaceReserved="false"
android:defaultValue="false"
android:key="key1"
android:title="title1" />
<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="false"
android:key="@string/pref_wakeup"
android:title="key2" />
</PreferenceScreen>
Another option is to set your own adapter. That way you have more flexibility and it's more robust against changes.
See that other answer about custom header adapter