Android的列表视图放慢滚动速度视图、速度、列表、Android

2023-09-04 08:21:09 作者:泪已成哀

在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之前,摩擦是在滚轮,硬codeD,有没有简单的方法来改变滚动视图的滚轮滚轮本身是很简单,但在 AbsListView 是私有的,所以你不能只是延长的ListView

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.