Notes for Android listview

Source: Internet
Author: User

The first is the stackfrombottom attribute. After this attribute is set, the list you prepared will display the bottom of your list, with values true and false.
Android: stackfrombottom = "true"

The second is the transciptmode attribute. You need to use listview or other controls that display a large number of items to track or view information in real time, and you want the latest entries to automatically scroll to the visible range. By setting the transcriptmode attribute, You can automatically slide the Android platform control (scrollbar supported) to the bottom.
Android: transcriptMode = "alwaysScroll"

The third cachecolorhint attribute, many people want to change its background so that it can adapt to the overall uidesign. To change the background, it is easy to prepare an image and specify the attribute Android: background = "@ drawable/BG", but don't be too happy. When you do this, you will find that the background has changed, but when you drag, you can also click the blank position in the list to find that all listitems are black, damaging the overall effect.
If you only change the background color, you can directly specifyAndroid: cacheColorHintIf you use an image as the background, you only need to setAndroid: cacheColorHint is specified as transparent (#00000000)You can.

The fourth divider attribute is used to set an image between each item as an interval or remove the split line between items.
Android: divider = "@ drawable/list_driver"@ Drawable/list_driver is an image resource. If you do not want to display the split line, set itAndroid: divider = "@ drawable/@ null"You can.
The fifth fadingedge attribute has a black shadow on the top and bottom.
Android: fadingEdge = "none"No shadow after setting ~

FifthThe scrollbars attribute is used to hide the listview scroll bar,
Android: scrollbars = "none" and setVerticalScrollBarEnabled (true); have the same effect. They are hidden when they are not active, and hidden when they are active.

Sixth, fadeScrollbars attributes,Android: fadeScrollbars = "true"When configuring the ListView layout, setting this attribute to true can automatically hide and display the scroll bar.

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.