tags:

views:

38

answers:

3

Starting with 2.2, scrollbars would disappear once the scrolling has stopped.
Is there a way to make them always visible like before?

+2  A: 

What about View.setScrollbarFadingEnabled(boolean fadeScrollbars)? This is available since API level 5.

mreichelt
A: 

There is also the XML value if you wish to define this in your XML layout file.

android:scrollbarAlwaysDrawHorizontalTrack="true"
android:scrollbarAlwaysDrawVerticalTrack="true"

http://developer.android.com/reference/android/view/View.html#attr_android:scrollbarAlwaysDrawHorizontalTrack

You can also set a delay if you actually want the fading just not quite so fast!

android:scrollbarDefaultDelayBeforeFade="500"
Blundell
A: 

A helper method:

public static void disableScrollbarFading(View view) {
    try {
        Method setScrollbarFadingEnabled = View.class.getDeclaredMethod(
                "setScrollbarFadingEnabled", boolean.class);
        setScrollbarFadingEnabled.setAccessible(true);
        setScrollbarFadingEnabled.invoke(view, false);
    } catch (Exception e) {
        // OK, API level < 5
    }
}
alex