Is there any better way to draw a black horizontal line than defining layout with fixed height and black background?
+1
A:
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.
Janusz
2010-07-13 09:16:42
It works with drawable, but it's not shown when it is a color defined in xml. I read that it's a bug - do you know from which Android version it was fixed?
pixel
2010-07-13 14:34:55
I'm developing against 1.6 (SDK Version 4) and it works with xml defined colors. I can post code if you are interested.
slup
2010-07-13 14:41:09
My target platform is 1.5 and it doesn't work, so this might suggest that they fixed it in Donut.
pixel
2010-07-13 19:08:28
A:
API Demos List5.java demonstrates including separators, using android.R.layout.simple_expandable_list_item_1
Stephen Denne
2010-07-13 09:36:49