开发者

Android hide listview scrollbar?

开发者 https://www.devze.com 2023-03-28 06:52 出处:网络
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

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

精彩评论

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

关注公众号