滚动视图中的滚动条只有在我开始滚动时才可见。 我怎么才能一直表现出来呢?
当前回答
设置android:scrollbarFadeDuration="0"就可以了。
其他回答
设置android:scrollbarFadeDuration="0"就可以了。
尝试android:scrollbarAlwaysDrawVerticalTrack="true"垂直。 和尝试android:scrollbarAlwaysDrawHorizontalTrack="true"水平
样式你的滚动条可见性,颜色和厚度像这样:
<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"/>
希望能帮你节省时间。
到目前为止,最好的方法是使用android:fadeScrollbars="false"在xml中,这相当于ScrollView.setScrollbarFadingEnabled(false);在Java代码中。
android:scrollbarFadeDuration="0"有时不工作后,我退出应用程序,重新开始。所以我添加gallery。setscrollbarfadingenabled (false);到活动,它的工作!
推荐文章
- Android API 21工具栏填充
- Android L中不支持操作栏导航模式
- 如何在TextView中添加一个子弹符号?
- PreferenceManager getDefaultSharedPreferences在Android Q中已弃用
- 在Android Studio中创建aar文件
- 修改抽射超时时间
- 如何通过数据从第二个活动到第一个活动时按回?——安卓
- 如何在android中获得当前前景活动上下文?
- 如何在Android中获取当前日期?
- 获取Android设备名称
- 在WebView中上传文件
- 加载HTML文件到WebView
- Android:为什么视图没有maxHeight ?
- 如何获得具有已知资源名称的资源id ?
- 在Android上将字符串转换为整数