滚动视图中的滚动条只有在我开始滚动时才可见。 我怎么才能一直表现出来呢?


当前回答

android:scrollbarFadeDuration="0"有时不工作后,我退出应用程序,重新开始。所以我添加gallery。setscrollbarfadingenabled (false);到活动,它的工作!

其他回答

尝试这作为上面的建议没有为我工作时,我想这样做的TextView:

TextView.setScrollbarFadingEnabled(false);

祝你好运。

不要忘记添加android:scrollbars="vertical"和android:fadeScrollbars="false",否则在某些情况下它根本不会显示。

样式你的滚动条可见性,颜色和厚度像这样:

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/recycler_bg"

        <!--Show Scroll Bar-->
        android:fadeScrollbars="false"
        android:scrollbarAlwaysDrawVerticalTrack="true"
        android:scrollbarFadeDuration="50000"

        <!--Scroll Bar thickness-->
        android:scrollbarSize="4dp"

        <!--Scroll Bar Color-->
        android:scrollbarThumbVertical="@color/colorSecondaryText"/>

希望能帮你节省时间。

使用awakenScrollBars()唤醒滚动条绘制。

android:scrollbarFadeDuration="0"有时不工作后,我退出应用程序,重新开始。所以我添加gallery。setscrollbarfadingenabled (false);到活动,它的工作!