Is there any better way to draw a black horizontal line than defining l开发者_StackOverflowayout with fixed height and black background?
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.
API Demos List5.java demonstrates including separators, using android.R.layout.simple_expandable_list_item_1
精彩评论