Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to always show scrollbar

The scrollbar in my scrollview is only visible when I start scrolling. How can I always show it?

like image 789
jul Avatar asked Oct 05 '22 09:10

jul


People also ask

How do I make my scroll bar always show?

When Settings opens, click “Accessibility” in the sidebar. In Accessibility, select “Visual Effects.” In Visual Effects, flip the switch beside “Always Show Scrollbars” to the “On” position. And that's it!

How do I keep my scroll bar from disappearing?

Go to Settings / Ease of Access / Display and turn off Automatically hide scroll bars in Windows. Scroll bars will then always be full-size in many (but not all) places.


3 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.

like image 616
Rejinderi Avatar answered Oct 10 '22 00:10

Rejinderi


Setting the android:scrollbarFadeDuration="0" will do the trick.

like image 61
Tanmay Mandal Avatar answered Oct 09 '22 23:10

Tanmay Mandal


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!

like image 52
Tudor Luca Avatar answered Oct 09 '22 23:10

Tudor Luca