Android -- ListView split line, androidlistview
Xml Code
- <LinearLayout
- Xmlns: android = "http://schemas.android.com/apk/res/android"
- Android: layout_width = "wrap_content"
- Android: layout_height = "wrap_content">
- <ListView
- Android: id = "@ + id/android: list"
- Android: layout_width = "wrap_content"
- Android: layout_height = "wrap_content"
- Android: divider = "# FFCC00"
- Android: dividerHeight = "4px"/>
- </LinearLayout>
The system control on the Android platform provides flexible custom options. All widgets implemented based on ListView or AbsListView can set the line spacing through the following methods,The split line can be customized by color or image..
In ListView, we use the property android: divider = "# FF0000" to define the separator as red. Of course, the value here can point to a drawable image object, if the image height is greater than the system's default pixel, you can set the height by yourself, for example, 6 pixels android: dividerHeight = "6px ", android Development Network prompts that, of course, ListView can also be set in Java.