开发者

Listview hide scrollbar when not scrolling

开发者 https://www.devze.com 2023-01-22 16:30 出处:网络
As the title says I want to hide a listview\'s scrollbar when the listview isn\'t scrolling and show it when scrolling. I know this can be done very easy by setting \"android:fadeScrollbars\" as an ap

As the title says I want to hide a listview's scrollbar when the listview isn't scrolling and show it when scrolling. I know this can be done very easy by setting "android:fadeScrollbars" as an application style if the API is 5 or newer. But I want the feature to be available on all android devices. So I've implemented the "setOnScrollListener" method, and switched the scrollbar visibility using the setVerticalScrollBarEnabled method. This works great on G2开发者_运维知识库. The problem is that on Motorola Milestone the SCROLL_STATE_IDLE event isn't received when the scrolling stops, and so the scrollbar remains visible.

Thank you for reading!


Instead of using setOnScrollListener, I've used setOnTouchListener and switched the scrollbar's visibility at the MotionEvent.ACTION_DOWN and MotionEvent.ACTION_UP events.


Whatever I could have said as a solution has already been done by you. Sorry! but thanks a lot for posting that this particular Moto has this issue.

0

精彩评论

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