Search code examples
androidlistviewhideseparatordivider

Android. Hide certain listview separator


How I can hide or delete certain listview separator? Of course I can hide all dividers

getListView().setDivider( null ); 
getListView().setDividerHeight(0); 

but I need hide one or two dividers in my listview. for example by position. I am using custom Adapter for list data. Thanks.


Solution

  • You can either create a custom View for each ListItem where you can turn on or turn off the separator, or you can create a separator view that you add into your list view at the proper locations.