Question

i have seen a lot of android apps those have a ListView that some differences with my ListViews. in theire ListView Scroll bar seen like this:

enter image description here

in picture above when you scroll your list that scroll bar will be shown and u can touch on it and scroll easier.

but in my app seen like this:

enter image description here

this is my layout xml code:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:paddingBottom="4dp"
        android:text="@string/do"
        android:textSize="16dp" />

    <ListView
        android:id="@+id/lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/main_background"

        >
    </ListView>
</LinearLayout>

i had googled many times but i didnt find any trick. can anybody help me how i can make my scroll like picture one?

Was it helpful?

Solution

You can add these lines in your listview. It worked for me.

    android:fastScrollEnabled="true"
    android:scrollbars="none

OTHER TIPS

set android:fastScrollEnabled="true" in properties of the listview. Also if you want fast scroll thumb to be visible always, set android:fastScrollAlwaysVisible="true"

then, in your xml definition of the listview, you would have something like this:

<ListView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:fastScrollAlwaysVisible="true"
    android:fastScrollEnabled="true" >
</ListView>
Hi Use This attribute in your ListView which you declare in you layout file.

android:scrollbars="none"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top