问题描述
我试图滚动stopped.So后做什么,我试图用 OnScrollListener#onScrollStateChanged(SCROLL_STATE_IDLE)
,以检测当滚动停止(以 TOUCH_SCROLL或FLING
)(1.5是运行像我期望的那样)。但是,当它运行在2.0,onScrollStateChanged不能接受的情况下释放finger.Is有任何回调或反正检测到事件之后?
I'm trying to do something after scrolling stopped.So, I tried using OnScrollListener#onScrollStateChanged(SCROLL_STATE_IDLE)
to detect when the scrolling stopped(either TOUCH_SCROLL or FLING
)(at 1.5 it's runs as i expect).But when it runs on 2.0, onScrollStateChanged can't received the event after releasing the finger.Is there any callback or anyway to detect that event?
推荐答案
尝试使用setOnScrollListener并实现onScrollStateChanged与scrollState == 0 ...做你需要做的......
Try using the setOnScrollListener and implement the onScrollStateChanged with scrollState == 0 ... do what you need to do...
setOnScrollListener(new OnScrollListener() {
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
// TODO Auto-generated method stub
}
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
Log.i("a", "scrolling stopped...");
}
}
});
这篇关于如何检测的Android ListView的滚动停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!