Turn: Android listview has several special attributes

Source: Internet
Author: User
Turn: Android listview has several special attributes

 

As listview is being made in the past two days, some attributes that I personally think are special are sorted out. By setting these attributes, you can make a more beautiful list.

FirstIt 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"

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 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"

third cachecolorhint attribute, many people want to change the background so that they can adapt to the overall uidesign, to change the background, you only need to prepare an image and specify the attributes Android: Background =" @ drawable/BG " but don't be happy too early. 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: cachecolorhintSpecify as transparent (#00000000)You can.

FourthDivider attribute, which 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,Hidden during non-activity and during activity

SixthThe fadescrollbars attribute. When Android: fadescrollbars = "true" is used to configure the listview layout, setting this attribute to true can automatically hide and display the scroll bar.

Related Article

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.