0

When I scroll the list, fastscroll thumb is showed but the scrollbar thumb and track not showed.

Here is my XML code:

<ListView
        android:id="@+id/list_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbarTrackVertical="@drawable/bg_scroll"
        android:scrollbarThumbVertical="@drawable/scroll_bar"
        android:divider="@drawable/list_line"
        android:fastScrollEnabled="true"`/>

My fastscroll thumb drawable is setted in styles.xml AppTheme.

Gowthaman M
  • 8,057
  • 8
  • 35
  • 54
Tu Do
  • 1

2 Answers2

0

Please check the data you passed to list view because fast scroll is only displayed when you have more list items to scroll.

Make sure you have these lines in recycler view tag

app:fastScrollHorizontalThumbDrawable="@drawable/thumb_drawable"
app:fastScrollHorizontalTrackDrawable="@drawable/line_drawable"
app:fastScrollVerticalThumbDrawable="@drawable/thumb_drawable"
app:fastScrollVerticalTrackDrawable="@drawable/line_drawable">
  • My fastscroll is displayed, but the scrollbar track and thumb is not. – Tu Do Sep 04 '18 at 06:08
  • I updated the answer. Check/add that in your code and Let me know if that helps. – Gouse Mohiddin Sep 04 '18 at 11:32
  • I use listview.When my list size is greater than or equal to 4 pages, fast scroll works; normal scrollbar thumb, track (not the track of fastscroll) don't work. I want normal scrollbar thumb, track always show and fastscroll enable when scrolling the list. – Tu Do Sep 11 '18 at 06:26
-1

Since you have set android:fastScrollEnabled="true" you need to set the fastScroll properties like android:fastScrollTrackDrawable="@drawable/"and 'android:fastScrollThumbDrawable="@drawable/". And also consider what @Gouse Mohiddin has said. You need to have enough rows inside to make it scrollable.

Bikash Das
  • 147
  • 1
  • 12