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.
Asked
Active
Viewed 1,228 times
0

Robert
- 35
- 8
-
Post some relevant code and I'm sure people will help ... – Mark Mar 29 '16 at 16:34
-
@Mark I wish to post something, which at least tries to remove those lines, but I could not find the solution. Posting a standard code for PreferenceActivity (and its layout) is not useful in this case, I believe. – Robert Mar 29 '16 at 16:40
1 Answers
2
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