Android Listview 减慢滚动速度 [英] Android Listview slow down scroll speed
问题描述
ListView 中的滚动速度对于我的应用程序来说太快了.我需要把它放慢很多.
The scroll speed in the ListView is way too fast for my application. I need to slow it down by a lot.
我不知道如何做到这一点.我在文档中唯一能找到的是一个setFriction"函数,它只在 API 级别 11 中受支持,以及一个静态的getScrollFriction"方法,它不能被覆盖并且没有相应的 setter.
I can't figure out how to do this. The only things I could find in the documentation are a "setFriction" function which is only supported in API Level 11, and a static "getScrollFriction" method which can't be overridden and has no corresponding setter.
这里有什么技巧 - 如何控制滚动速度?
What's the trick here - how do I control the scroll speed?
谢谢.
推荐答案
已验证这对于 API >= 11 非常有效:
Verified that this works really nicely for API >= 11:
listView.setFriction(ViewConfiguration.getScrollFriction() * FRICTION_SCALE_FACTOR)
请注意,滚动速度会随着摩擦力的增加而降低.为了适当地减少滚动动量,我最终使用了摩擦比例因子 10.YMMV.
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.
这篇关于Android Listview 减慢滚动速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!