Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Always show scrollbars for PreferenceScreen

I have defined preferences in my app using preferences.xml and a PreferenceActivity. The settings are presented in the phone in a ScrollView-like-way. I would like to always show the vertical scrollbars all the time. In Android 1.6 they do not fade away, but in Android 2.2 the fade away after about a second. In a ScrollView I can control this using android:scrollbarAlwaysDrawVerticalTrack or android:scrollbarDefaultDelayBeforeFade. How can I do this with the preference widget?

/P

like image 385
per_jansson Avatar asked Nov 14 '25 12:11

per_jansson


1 Answers

This worked for my Android 2.3.3 .

public class MyPreferenceActivity extends PreferenceActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getListView().setScrollbarFadingEnabled(false);
        ...
    }
    ...
}
like image 133
taqanori Avatar answered Nov 17 '25 07:11

taqanori