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


当前回答

我也有同样的问题。酒吧的背景颜色是一样的。试一试:

android:scrollbarThumbVertical="@android:color/black"

其他回答

setVertical*帮助以编程方式使垂直滚动条始终可见

scrollView.setScrollbarFadingEnabled(false);
scrollView.setVerticalScrollBarEnabled(true);
scrollView.setVerticalFadingEdgeEnabled(false);

这两条加起来对我很有用:

android:scrollbarFadeDuration="0"
android:scrollbarAlwaysDrawVerticalTrack="true"

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

TextView.setScrollbarFadingEnabled(false);

祝你好运。

android:scrollbarFadeDuration="0"有时不工作后,我退出应用程序,重新开始。所以我添加gallery。setscrollbarfadingenabled (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"/>

希望能帮你节省时间。