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>
System controls in the Android platform provide flexible customization options, and all widget controls that are based on the ListView or Abslistview implementation can set line spacing split lines by using the following method, which allows you to customize the color, or picture .
In the listview we use the attribute android:divider= "#FF0000" to define the delimiter to be red, of course, here the value can point to a drawable picture object, if the use of the picture may be higher than the system default pixels, you can set the height such as 6 pixels Android:dividerheight= "6px", the Android Development network hint of course in Java in the ListView also has related methods can be set.
Android--listview Split Line