Android -- ListView split line, androidlistview

Source: Internet
Author: User

Android -- ListView split line, androidlistview
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>

 

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.

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.