PreferenceFragmentCompat has padding on PreferenceCategory that I can't get rid of

后端 未结 6 1470
小鲜肉
小鲜肉 2020-11-29 04:38

So I\'ve been trying to create a settings activity using androidx.preference.PreferenceFragmentCompat and it\'s all working fine.

However for some reason there is so

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 04:54

    Actually there is a better hack to fix this, also with resource overriding:

    Create res/values-sw360dp-v13/values-preference.xml:

    
    
    
        false
        0dp
    
    

    The fixes the default value of iconSpacePreserved for all Preference; The fixes the PreferenceCategory.

    EDIT: If you are using androidx.preference:preference:1.1.0-alpha01 or above, you won't need the preference_category_padding_start fix and config_materialPreferenceIconSpaceReserved only will be enough.

提交回复
热议问题