Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ListView different divider images

In ListView I can change the divider image using android:divider=image but I want to display different divider images for different items how can I do that ?

like image 617
d-man Avatar asked Nov 22 '09 19:11

d-man


2 Answers

Why not have no divider images and make the divider part of the View for each item?

For example, at the top of the view you have a label and an icon and at the bottom you have your divider image.

like image 116
Dave Webb Avatar answered Sep 21 '22 01:09

Dave Webb


AFAIK there is no means to have different dividers in different locations in a single list. Either follow Mr. Webb's recommendation (i.e., put the "dividers" in the list items), or keep a consistent divider, or perhaps subclass/reimplement ListView to provide the functionality you seek.

like image 31
CommonsWare Avatar answered Sep 20 '22 01:09

CommonsWare