Search code examples
androidandroid-layoutandroid-scrollviewandroid-scrollbar

How I can show ScrollView scroll-bar for 2 seconds on activity create?


I just want to show the scrollbar for 2 sec when view is created. Is there any attribute for this?

Actually it show when user touch the screen but I want to show it automatically for a few seconds so user can know this view is scroll-able.

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbarDefaultDelayBeforeFade="2000"
    android:scrollbarAlwaysDrawVerticalTrack="true">

Solution

  • add the android:id attribute in the xml for ScrollView and in the activity use timer or countdowntimer for 2 sec notification and on completion set the visibility of the ScrollView to invisible.