android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb" //滚动条
scrollbar_vertical_track.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:startColor="#3333FF" android:endColor="#8080FF"
android:angle="0"/>
<corners android:radius="6dp" />
</shape>
scrollbar_vertical_thumb.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:startColor="#505050" android:endColor="#C0C0C0"
android:angle="0"/>
<corners android:radius="0dp" />
</shape>
这篇博客介绍了如何在Android中自定义Scrollbar的样式,包括垂直滚动条的轨道和拇指的XML定义,使用了形状和渐变颜色来实现不同的视觉效果。
894

被折叠的 条评论
为什么被折叠?



