Glemi
Glemi

Reputation: 745

How can I get rid of the gap between my listview list items (android)

I'm trying to get rid of this 1px gap between lititems in my ListView. I know this is normally defined by the listview's dividerHight property. But this property was not set in my layout file.

Setting it to 0px or 0.0dp didn't help either. I may have caused these gaps somehow programmatically but I don't remember now.

By the way, I have 4 different view types, i.e. different listitem layouts. This should rule out the possiblity of the gap being defined in the listitem layout.

Upvotes: 1

Views: 323

Answers (1)

Michael Cheremuhin
Michael Cheremuhin

Reputation: 1393

Try this in xml:

android:divider="@null"

Or this from code:

yourListView.setDivider(null);

Upvotes: 5

Related Questions