The scrollbar in my scrollview is only visible when I start scrolling. How can I always show it?
15 Answers
As of now the best way is to use android:fadeScrollbars="false"
in xml which is equivalent to ScrollView.setScrollbarFadingEnabled(false);
in java code.

- 8,667
- 7
- 35
- 50

- 11,694
- 2
- 31
- 40
-
for ListView didn't work, but this worked: `view.setScrollBarFadeDuration(0);` – user924 Dec 09 '17 at 17:24
-
3so the right and accepted answer should be @Tanmay Mandal answer (`setScrollBarFadeDuration(0)`), because `setScrollbarFadingEnabled(false)` doesn't work everywhere – user924 Dec 09 '17 at 17:26
-
or it stops works for example because of like described here https://stackoverflow.com/a/6673848/7767664 (onStop, onStart again and faield), so `setScrollBarFadeDuration(0);` is more reliable – user924 Dec 09 '17 at 17:29
-
1One thing to note is the scrollbar will not show when the view is not scrollable ✓ – James Jul 28 '22 at 19:15
-
I needed this on my recyclerview to both have the bar and always see it `android:scrollbars="vertical" android:fadeScrollbars="false"` – brando f Nov 22 '22 at 18:01
There are 4 ways:
- From Java code:
ScrollView.setScrollbarFadingEnabled(false);
- From XML code:
android:fadeScrollbars="false"
- From Java code:
myView.setScrollBarFadeDuration(0)
- From XML code:
android:scrollbarFadeDuration="0"
Simple as that!

- 7,611
- 5
- 39
- 71

- 6,259
- 2
- 29
- 44
Don't forget to add android:scrollbars="vertical"
along with android:fadeScrollbars="false"
or it won't show at all in some cases.

- 7,045
- 2
- 50
- 56
Style your scroll bar Visibility, Color and Thickness like this:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/recycler_bg"
<!--Show Scroll Bar-->
android:fadeScrollbars="false"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarFadeDuration="50000"
<!--Scroll Bar thickness-->
android:scrollbarSize="4dp"
<!--Scroll Bar Color-->
android:scrollbarThumbVertical="@color/colorSecondaryText"/>
Hope it help save some time.

- 69,473
- 35
- 181
- 253

- 41,955
- 17
- 205
- 154
Try this as the above suggestions didn't work for me when I wanted to do this for a TextView:
TextView.setScrollbarFadingEnabled(false);
Good Luck.

- 5,104
- 4
- 38
- 61
Try android:scrollbarAlwaysDrawVerticalTrack="true"
for vertical.
and Try android:scrollbarAlwaysDrawHorizontalTrack="true"
for horizontal

- 7,126
- 4
- 28
- 29
Since neither of the above worked for me, here's what did: android:scrollbarDefaultDelayBeforeFade="500000"

- 3,881
- 1
- 25
- 30
android:scrollbarFadeDuration="0"
sometimes does not work after I exit from the apps and start again. So I add gallery.setScrollbarFadingEnabled(false);
to the activity and it works!

- 111
- 1
- 6
These two together worked for me:
android:scrollbarFadeDuration="0"
android:scrollbarAlwaysDrawVerticalTrack="true"

- 7,281
- 12
- 53
- 64
I had the same problem. The bar had the same background color. Try:
android:scrollbarThumbVertical="@android:color/black"

- 1,190
- 12
- 20
setVertical* helped to make vertical scrollbar always visible programmatically
scrollView.setScrollbarFadingEnabled(false);
scrollView.setVerticalScrollBarEnabled(true);
scrollView.setVerticalFadingEdgeEnabled(false);

- 106
- 1
- 3
Setting this will do the trick. Change the @drwable for own style.
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:fadeScrollbars="false"
android:scrollbarThumbVertical="@drawable/scroll"`

- 2,746
- 5
- 28
- 45

- 196
- 1
- 10