Android-----ListView Properties Daquan

Source: Internet
Author: User


Http://www.cnblogs.com/zhengbeibei/archive/2013/03/29/2988814.html

<?xml version= "1.0" encoding= "Utf-8"?>
<listview xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:id= "@+id/listview"
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"
Android:cachecolorhint= "#00000000"
android:dividerheight= "30px"
android:divider= "@drawable/ic_launcher"
Android:fadingedge= "Vertical"
Ten android:scrollbars= "Horizontal|vertical"
Android:fastscrollenabled= "true"
Android:scrollbarstyle= "Outsideinset"
/>
<!--
Android:cachecolorhint= "#00000000"//Set drag background color to transparent
android:dividerheight= height between "30px"//listview Item
android:divider= "@drawable/ic_launcher"//listview the background, or color, between the item.
Android:fadingedge= "vertical"//top and bottom have a black shadow value of none so there is no shadow
android:scrollbars= "Horizontal|none"//Only when the value is horizontal|vertical, the scroll bar is displayed and will be automatically hidden and displayed
Android:fastscrollenabled= "true"///fast scrolling effect, configure this property, in the fast scrolling time will appear next to a small box of fast scrolling effect, automatically hide and display,
Android:scrollbarstyle= "Outsideinset"//Four values have the following meanings
1>outsideinset: The scrollbar is displayed at the edge of the view, adding the view's padding. If possible, the scrollbar only covers the background of the view.
2>outsideoverlay: The scrollbar is displayed on the edge of the view, without adding the view's padding, the scrollbar will be covered in semitransparent
3>insideinset: The scrollbar appears in the padding area, adding the padding area of the control, which does not overlap the contents of the view.
25

4>insideoverlay: The scrollbar is displayed inside the content area without adding the padding area of the control, which overrides the view content in a translucent style.

The first is the Stackfrombottom property, which is only after the list that you do well displays the bottom of your list, with a value of true and False

Android:stackfrombottom= "true"

The second is the Transciptmode property, which needs to be tracked or viewed 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"

The third Cachecolorhint attribute, 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 property android:background= "@drawable/bg", But do not 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 when 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

The Divider property, which is the function of each item needs to set a picture as an interval, or remove the split line between item

android:divider= "@drawable/list_driver" where @drawable/list_driver is a picture resource, if you do not want to display the split line as long as it is set to android:divider= "@ drawable/@null "It's OK.

Fifth Fadingedge property, with black shadows on top and bottom

Android:fadingedge= "None" after setting no Shadow ~

The fifth ScrollBars property, which is to hide the scroll bar of the ListView,

Android:scrollbars= "None" with setverticalscrollbarenabled (true); the effect is the same, not active when hidden, when the activity is also hidden

The sixth Fadescrollbars property, android:fadescrollbars= "True" when configuring the ListView layout, sets this property to True to enable the automatic hiding and display of the scroll bar.
--

Android-----ListView Properties Daquan

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.