Reputation: 641
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:
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:
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?
Upvotes: 2
Views: 1652
Reputation: 426
You can add these lines in your listview. It worked for me.
android:fastScrollEnabled="true"
android:scrollbars="none
Upvotes: 5
Reputation: 901
Hi Use This attribute in your ListView which you declare in you layout file.
android:scrollbars="none"
Upvotes: -1
Reputation: 647
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>
Upvotes: 3