当用户滚动列表视图时,我想显示/隐藏视图。
如何检测过度滚动?有听众吗?
我已尝试过OnScrollListener
,但它只会通知onScrollStateChanged
和onScroll
答案 0 :(得分:18)
您可以覆盖方法onOverScrolled,因为它respond to the results of an over-scroll operation.
答案 1 :(得分:1)
更完整的答案
[d.values() for d in scan_list]
答案 2 :(得分:1)
scrollY =非零,clampedY = true->在从下到上滚动时出现了OverScroll状态
scrollY = 0,clampedY = true->从上到下滚动时出现OverScroll状态
如此
@Override
protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
if(clampedY){
if(scrollY==0){
//over Scroll at top
}else {
//over Scroll at Bottom
}
}
}