Several important properties of Android ListView

Source: Internet
Author: User

1. Transciptmode Property , you need to track or view information in real time with a ListView or other control that displays a large number of items, and you want the latest entries to automatically scroll to the viewable range. By setting the Control Transcriptmode property, you can automatically slide the controls on the Android platform (support ScrollBar) to the bottom.

Android:transcriptmode= "Alwaysscroll"

2, Divider property , this property is required to set a picture between each item as an interval, or remove the split line between item android:divider= "@drawable/list_driver" where @drawable/ List_driver is a picture resource, and if you do not want to display the split line, you can set it to android:divider= "@drawable/@null" as well, and the property can also set the background color directly.

Android:divider= "#00000000"

3, Fadingedge property , the top and bottom of the black Shadow, android:fadingedge= "None" after the setting has no shadow.

4, the ScrollBars property , the function is to hide the ListView scroll bar, android:scrollbars= "None" and setverticalscrollbarenabled (true); the effect is the same, Hide when not active, and hide when active.

5, Fadescrollbars property , android:fadescrollbars= "true" when configuring the ListView layout, set this property to True to enable the automatic hiding and display of scroll bars.

6, Stackfrombottom Property , this property will display the bottom of your list, with a value of true and false, as soon as you make a good list.

Android:stackfrombottom= "true"

7. Transciptmode Property , you need to track or view information in real time with a ListView or other control that displays a large number of items, and you want the latest entries to automatically scroll to the viewable range. By setting the Control Transcriptmode property, you can automatically slide the controls on the Android platform (support ScrollBar) to the bottom.

Android:transcriptmode= "Alwaysscroll"

8, Cachecolorhint attributes , many people want to be able to change its background, so that he can conform to the overall UI design, change the background is very simple only need to prepare a picture and then specify the attribute android:background= "@drawable /BG ", but don't be happy too early, when you do this, you find that the background is changed, but when you drag, or click on the list blank position to find that the ListItem has become black, destroying the overall effect.

If you just change the color of the background, you can directly specify Android:cachecolorhint as the color you want, if you are using a picture to do the background, it will be as long as the android:cachecolorhint is specified as transparent (#00000000) can be

Several important properties of Android ListView

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.