Since these two days in doing the ListView thing, so sort out some of my personal think more special properties, by setting such a property can make a more beautiful list
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 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
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 sixth 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 seventh 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.
Eighth fastscrollenabled Property ,
Many developers do not know how the quick scroll slider for the ListView list control is enabled, and here the Android Development network tells you that the secondary scroll slider can be done with just one line of code, and if you use an XML layout you only need to add Android to the ListView node: Fastscrollenabled= "true" to this property, while for Java code can pass mylistview.setfastscrollenabled (true); To control enable, the parameter false is hidden. Another thing is that when your scrolling content is small, this quick scroll slider does not appear when you are less than the 3 screen height of the current ListView, and the method is still the underlying method of Abslistview, and you can use fast scrolling assistance in subclasses such as the ListView or GridView.
Nineth Drawselectorontop Property
When set to True, the selector is drawn over the SelectedItem. Otherwise The selector is drawn behind the selected item. Thedefault value is false.
Android:drawselectorontop= "true" click on a record, the color will be displayed on the top, the text on the record is obscured, so click on the text, text will not see
Android:drawselectorontop= "False" click on a record, the color will be behind the record, the background color, but the text of the recording content is visible.
Reference Original: http://blog.csdn.net/avenleft/article/details/7334060
Several important properties of Android ListView