Android--listview Split Line

Source: Internet
Author: User

XML code
  1. <LinearLayout
  2. xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="wrap_content"
  4. android:layout_height="wrap_content">
  5. <ListView
  6. android:id="@+id/android:list"
  7. android:layout_width="wrap_content"
  8. android:layout_height="wrap_content"
  9. android:divider="#FFCC00"
  10. android:dividerheight="4px"/>
  11. </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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.