停止滚动的ListView动画 [英] Stop ListView scroll animation

查看:263
本文介绍了停止滚动的ListView动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的ListView 约100项。当用户执行的抛球从下到上它开始滚动,并不断滚动,即使在手指不接触显示器了。

I have a ListView with about 100 entries. When the user does the "fling" from bottom to top it starts scrolling and keeps on scrolling even when the finger does not touch the display any more.

有没有办法停止滚动动画在这一点?

Is there a way to stop the scrolling animation at this point?

推荐答案

那么肯定有一种方法可以做到这一点。但问题是,更多的是否是最好做的,在我看来。

Well there surely is a way to do it. But the point is more whether or not it is advisable to do it, in my opinion.

该列表是一个标准的Andr​​oid控件的行为constistently在所有应用程序。所以,我会感到很惊讶,如果我发现,没有在你的应用程序具有相同的行为列表。你可以把你的手指背在屏幕上随时停止一扔。

The list is a standard Android control that behaves constistently across all applications. So I would be surprised if I found a list that did not behave the same in your application. You can stop the fling by putting your finger back on the screen at any time.

这是说,如果你想要做一些额外的工作,你可以继承列表视图,并覆盖其上的触摸方式。知道该怎么做的最好的办法是让ListView的来源$ C ​​$ C(<一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/1.6_r2/android/widget/ListView.java"相对=nofollow> ListView控件中的Andr​​oid 1.6 )。

That said, if you want to do extra work, you could subclass the list view and override its on touch method. Best way to know what to do is to get the source code of ListView (ListView in Android 1.6).

这篇关于停止滚动的ListView动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆