Android hide listview scrollbar?

2019-01-21 08:24发布

Is there a way to hide scrollbar in ListView. I know it's possible for ScrollView but can't find a way for ListView scrollbar. Any ideas?

5条回答
该账号已被封号
2楼-- · 2019-01-21 08:56

Also make sure that fast scrolling disabled:

listView.setFastScrollEnabled(false);

Thanks, Rahul

查看更多
一夜七次
3楼-- · 2019-01-21 08:57

This is the property you should use on your ListView. All the best.

android:scrollbars="none"

查看更多
看我几分像从前
4楼-- · 2019-01-21 09:08

Try to type this in layout xml file

android:scrollbars="none"

Tutorial is here.

http://developer.android.com/reference/android/view/View.html#attr_android:scrollbars

Hope, it helps you

查看更多
神经病院院长
5楼-- · 2019-01-21 09:09

Usually using both of them

android:divider="@null"
android:dividerHeight="0dp"
查看更多
Ridiculous、
6楼-- · 2019-01-21 09:16

If you want to disable \ enable scrollbars programmatically you need use

View.setVericalScrollbarEnabled(boolean) - disable \ enable vertical scrollbars.

View.setHorizontalScrollBarEnabled(boolean) - disable \ enable horizontal scrollbars.

查看更多
登录 后发表回答