Reputation: 35
I am developing some app and I need to remove lines between Preferences, as shown on screenshot. Could you please help me to do that?
NOTE: I'm not going to change System Setting. This is just an example. The idea is to remove lines between Preferences in PreferenceActivity.
Upvotes: 0
Views: 1276
Reputation: 2619
The line you want to hide is called 'divider'. PreferenceActivity
extends ListActivity
and as you may expect it uses ListView
. You can change a divider in a ListView
. In your PreferenceActivity
:
ListView lv = getListView();
lv.setDivider(new ColorDrawable(Color.TRANSPARENT));
lv.setDividerHeight(0);
Check other topics android preference horizontal divider in custom preference, how to hide the divider between preferences in fragment, Change Divider color in Android PreferenceActivity
Upvotes: 2