0

Hello im making a listview and i can get the scroll bar to show up but it does not do anything.

    <ListView
        android:id="@+id/listView"
        style="@style/CustomTheme"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbarSize="30dip"
        android:scrollbarStyle="outsideInset"
        android:scrollbarThumbVertical="@color/blue"
        android:scrollbarTrackVertical="@drawable/side_nav_bar" />

How can i get it to work?

Joonatan
  • 25
  • 5
  • What behavior are you expecting? That is, how is it not working, exactly? – Mike M. Mar 09 '20 at 14:26
  • Does this answer your question? [Always show scrollbar for ListView](https://stackoverflow.com/questions/5978587/always-show-scrollbar-for-listview) – grrigore Mar 09 '20 at 14:28
  • I want it to scroll the listview when I'm dragging my thumb on the scrollbar. That does not answer the question. I can get it to show when dragging on list view entries. – Joonatan Mar 09 '20 at 14:32
  • You want the `fastScroll*` attributes instead, then; e.g., `fastScrollEnabled`, `fastScrollAlwaysVisible`, `fastScrollThumbDrawable`, etc. A regular scrollbar is just a non-interactive indicator. – Mike M. Mar 09 '20 at 14:33
  • 1
    This answered my question. Thank you! – Joonatan Mar 09 '20 at 14:40

1 Answers1

0

Ok, so I needed to add fastScroll to my activity.

<ListView
    android:id="@+id/listView"
    style="@style/CustomTheme"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbarSize="30dip"
    android:scrollbarStyle="outsideInset"
    android:fastScrollEnabled="true"
    android:scrollbarThumbVertical="@color/blue"
    android:scrollbarTrackVertical="@drawable/side_nav_bar" />
Joonatan
  • 25
  • 5