开发者

Listview hide scrollbar when not scrolling

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜