Android get view of Preference in PreferenceActivity

后端 未结 3 1764
慢半拍i
慢半拍i 2021-01-11 13:56

I would like to get View instance that is used to display specific Preference in my PreferenceActivity, so i can modify its properties, for example:

public          


        
3条回答
  •  萌比男神i
    2021-01-11 14:16

    I'm not sure on how to get the view for a preference, but if you want to remove the view from the screen (set visibility to View.gone) you can use the following:

    getPreferenceScreen().removePreference(thePreference)

提交回复
热议问题