Custom PreferenceCategory Headings

前端 未结 4 1013
耶瑟儿~
耶瑟儿~ 2020-11-28 19:45

I have a simple preference screen defined like this


    

        
4条回答
  •  孤独总比滥情好
    2020-11-28 20:14

    Like Gábor's answer but instead of extending PreferenceCategory you can do like this : 1. Make your custom layout.I named it preference_category.xml :

    
    
    
    
    
    

    Important : the layout must contain a textview with this id : android:id="@+android:id/title"

    2.and in the preference add this line : android:layout="@layout/preference_category"

    
    
    
    
    ... //  other preferences in the category
    
    
    

提交回复
热议问题