yanchenko
yanchenko

Reputation: 57186

Prevent scrollbar from hiding on froyo

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

Upvotes: 0

Views: 502

Answers (3)

Maz
Maz

Reputation: 764

You can also set this in the xml with android:fadeScrollbars="false".

Upvotes: 0

yanchenko
yanchenko

Reputation: 57186

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
    }
}

Upvotes: 3

mreichelt
mreichelt

Reputation: 12455

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

Upvotes: 2

Related Questions