开发者

Android hide listview scrollbar?

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


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


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.


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

android:scrollbars="none"


Also make sure that fast scrolling disabled:

listView.setFastScrollEnabled(false);

Thanks, Rahul


Usually using both of them

android:divider="@null"
android:dividerHeight="0dp"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜