user3199693
user3199693

Reputation: 148

How to add separator to listview (android)?

Is it possible to add separator view to listview without changing adapter's list of items?

I know that you can inflate different types of items with different layouts but that's not what i'm looking for. I dont want to change list of items which adapter uses. Only want to add separator at desired position.

Something similar to ListView#AddHeader. It adds view at the top of the list but doesn't change list of items.

I want to add view between two items, but don't want to change list of items.

Upvotes: 0

Views: 7173

Answers (1)

NightwareSystems
NightwareSystems

Reputation: 433

Is this what you're looking for? dividerHeight property.

<ListView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="5dp"
        android:dividerHeight="2dp" >

Upvotes: 1

Related Questions