Reputation: 4967
Can anybody tell me to remove the divider between rows in Android? I want to remove the third row divider in a custom List View.
Upvotes: 4
Views: 6072
Reputation: 3163
Edit your item layout to contain a Textview with a fixed height for the divider and spans over the full width, but is set to visibility=View.GONE. Then, only show those dividers that you want to show (by setting visibility = GONE or VISIBLE). If you wrap that layout with a custom view, this can be very comfortable in use. This way you don't interfere with some inner logic in your adapter/listview and you use direct mechanisms instead of building your layout on side effects.
Upvotes: 0
Reputation: 6614
have you seen this post how to change color of Android ListView Seperator line?
getView
method when position is 3 , do below
processesUpvotes: 0
Reputation: 7184
That would not be possible from the ListView
properties.
The alternative is to implement the divider in each row using a custom adapter and hide it when the index is 3 from the method:
public View getView(int position, View convertView, ViewGroup parent)
Upvotes: 1