滚动视图中的滚动条只有在我开始滚动时才可见。 我怎么才能一直表现出来呢?
当前回答
样式你的滚动条可见性,颜色和厚度像这样:
<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:scrollbarDefaultDelayBeforeFade="500000"
我也有同样的问题。酒吧的背景颜色是一样的。试一试:
android:scrollbarThumbVertical="@android:color/black"
这两条加起来对我很有用:
android:scrollbarFadeDuration="0"
android:scrollbarAlwaysDrawVerticalTrack="true"
使用awakenScrollBars()唤醒滚动条绘制。
有4种方法:
ScrollView.setScrollbarFadingEnabled(false); From XML代码:android:fadeScrollbars="false" myView.setScrollBarFadeDuration(0) android:scrollbarFadeDuration="0"
就这么简单!
推荐文章
- 从资产中读取文件
- 在不活动的地方调用getLayoutInflater()
- 设置Android布局元素的背景颜色
- 错误:'keytool'不能被识别为内部或外部命令、可操作程序或批处理文件
- 在应用程序本身中更改Locale
- apk (.apk)和应用程序包(.aab)的区别
- 如何设置超时在改造库?
- Android - SPAN_EXCLUSIVE_EXCLUSIVE跨度不能为零长度
- TextView的字体大小在Android应用程序改变字体大小从本机设置
- 如何模拟Android杀死我的进程
- 禁用EditText闪烁光标
- Android Eclipse -无法找到*.apk
- 设置TextView文本从html格式的字符串资源在XML
- 如何允许所有网络连接类型HTTP和HTTPS在Android(9)馅饼?
- Android加载JS包失败