让滚动条消失:
android:scrollbar="none"
让滚动条一直显示:
android:scrollbarFadeDuration="0"
android:fadeScrollbars="false"
快速滚动条自定义样式 反射修改mFastScroller属性
同时scrollbars属性设为none
try {
Field f = AbsListView.class.getDeclaredField("mFastScroller");
f.setAccessible(true);
Object o = f.get(li);
f = f.getType().getDeclaredField("mThumbDrawable");
f.setAccessible(true);
Drawable drawable = (Drawable) f.get(o);
drawable = getResources().getDrawable(R.drawable.hoteldetail_collect);
f.set(o, drawable);
} catch (Exception e) {
throw new RuntimeException(e);
}
设置垂直滚动条的图片
android:scrollbarThumbVertical="@drawable/scrollbarstyle"
参考:http://blog.csdn.net/zlqqhs/article/details/8536249