Android Listview slow down scroll speed

后端 未结 2 369
臣服心动
臣服心动 2020-12-01 16:26

The scroll speed in the ListView is way too fast for my application. I need to slow it down by a lot.

I can\'t figure out how to do this. The only things I could fin

相关标签:
2条回答
  • 2020-12-01 16:48

    Yes, there's no easy way. Before API 11, friction was hardcoded inside Scroller, and there's no simple way to change a scrolling view's Scroller. Scroller itself is quite simple, but the mScroller member in AbsListView is private, so you can't just extend ListView.

    0 讨论(0)
  • 2020-12-01 16:57

    Verified that this works really nicely for API >= 11:

    listView.setFriction(ViewConfiguration.getScrollFriction() * FRICTION_SCALE_FACTOR)
    

    Note that scroll speed decreases as friction increases. To decrease scroll momentum by a suitable amount, I ended up using a friction scale factor of 10. YMMV.

    0 讨论(0)
提交回复
热议问题