Android的滚动型,确认当前的滚动 [英] Android ScrollView, check if currently scrolling

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

问题描述

有没有一种方法来检查,如果滚动型标准目前正在滚动?

Is there a way to check if a standard ScrollView is currently being scrolled?

如果方向是向上或向下无所谓,我只需要检查它是否是目前在所有的滚动。

Doesn't matter if the direction is upwards or downwards, i only need to check whether it's currently being scrolled at all.

推荐答案

滚动型以目前的形式用于检测滚动事件不提供回调。有两种解决方法可供选择:

ScrollView in its current form does not provide a callback for detecting scroll events. There are two workarounds available:

1 使用的ListView 和实施的 OnScrollListener

1. Use a ListView and implement OnScrollListener.

2 从现有的滚动型实施派生自定义类和<一个href=\"http://stackoverflow.com/questions/3948934/synchronise-scrollview-scroll-positions-android/3952629#3952629\">extend它提供的回调,滚动事件的。

2. Derive a custom class from the existing ScrollView implementation and extend it to provide callbacks for scroll events.

这篇关于Android的滚动型,确认当前的滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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