문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top