Wednesday, September 7, 2016

Android ListView Attributes. (fastScrollEnabled)





1. Attributes of the Android ListView.

Attributes Description
divider Drawable or color to draw between list items.
dividerHeight Height of the divider.
entries Reference to an array resource that will populate the ListView.
footerDividersEnabled When set to false, the ListView will not draw the divider before each footer view.
headerDividersEnabled When set to false, the ListView will not draw the divider after each header view.
cacheColorHint Indicates that this list will always be drawn on top of solid, single-color opaque background.
choiceMode Defines the choice behavior for the view.
drawSelectorOnTop When set to true, the selector will be drawn over the selected item.
fastScrollEnabled Enables the fast scroll thumb that can be dragged to quickly scroll through the list.
listSelector Drawable used to indicate the currently selected item in the list.
scrollingCache When set to true, the list uses a drawing cache during scrolling.
smoothScrollbar When set to true, the list will use a more refined calculation method based on the pixels height of the items visible on screen.
stackFromBottom Used by ListView and GridView to stack their content from the bottom.
textFilterEnabled When set to true, the list will filter results as the user types.
transcriptMode Sets the transcript mode for the list.

2. Enabling the fast scroll thumb. (fastScrollEnabled)

The scroll function is activated since several items have been added to the ListView, you can use it by moving up or down while pressing and holding your finger. By the way, if a very large amount of items are in the ListView, There is a discomfort to have to take action to move several times to move to the last item on the first item.

In this case, you can make quick positioning by enabling "fastScrollEnabled" attribute and moving the thumb.

  * android:fastScrollEnabled - Enabling the fast scroll thumb.
        > true or false.

If you do not use "fastScrollEnabled" or set it to "false", the thumb is not appeared.

    <ListView
        android:id="@+id/listview1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

ListView Attrribute fastScrollEnabled false

If "fastScrollEnabled" is set to "true", you can see the thumb and make quick positioning by touch.

    <ListView
        android:id="@+id/listview1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fastScrollEnabled="true" />

ListView Attribute fastScrollEnabled true

3. References.

.END.

No comments:

Post a Comment