pixel
pixel

Reputation: 26441

How to draw horizontal line in ListView?

Is there any better way to draw a black horizontal line than defining layout with fixed height and black background?

Upvotes: 1

Views: 3135

Answers (2)

Stephen Denne
Stephen Denne

Reputation: 37007

API Demos List5.java demonstrates including separators, using android.R.layout.simple_expandable_list_item_1

Upvotes: 1

Janusz
Janusz

Reputation: 189464

The ListView allows you to define a divider drawable. See the android documentation on the ListView for more information.

The Divider will be drawn after each item in your list without the need for you to do anything about it. You can use a drawable or a color as the divider and you can also specify the divider height for the whole list.

Upvotes: 3

Related Questions