美文网首页
NestedScrollView 和RV的滑动监听

NestedScrollView 和RV的滑动监听

作者: wzg_gitee | 来源:发表于2020-12-13 16:52 被阅读0次

    嵌套监听 方法可用

      NoRootView.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
           if (scrollY > oldScrollY) {
               MyLog.e("向下滑动");
           }
           if (scrollY < oldScrollY) {
               MyLog.e("向上滑动");
           }
           if (scrollY == 0) {
               MyLog.e("滑动到顶部");
           }
           if (scrollY == (v.getChildAt(0).getMeasuredHeight() - v.getMeasuredHeight())) {
               MyLog.e("滑动到底部");
           }
       });
    
    
    

    相关文章

      网友评论

          本文标题:NestedScrollView 和RV的滑动监听

          本文链接:https://www.haomeiwen.com/subject/ozlpgktx.html