zoukankan      html  css  js  c++  java
  • nestedScrollview 嵌套使用recyclerview判断滑动到底部 (嵌套滑动导致 不能使用recyclerview的onscrolled监听)

    NestedScrollView scroller = (NestedScrollView) findViewById(R.id.myScroll);
    
    if (scroller != null) {
    
        scroller.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
            @Override
            public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
    
                if (scrollY > oldScrollY) {
                    Log.i(TAG, "Scroll DOWN");
                }
                if (scrollY < oldScrollY) {
                    Log.i(TAG, "Scroll UP");
                }
    
                if (scrollY == 0) {
                    Log.i(TAG, "TOP SCROLL");
                }
    
                if (scrollY == (v.getChildAt(0).getMeasuredHeight() - v.getMeasuredHeight())) {
                    Log.i(TAG, "BOTTOM SCROLL");
                }
           }
        });
    }
  • 相关阅读:
    es6之class继承
    es6-class基本语法
    vue-cli3搭建pwa项目(一)
    vue 组件的通信方式
    react之组件&props
    React之元素渲染
    JSX
    JSX
    在项目中怎么使用react
    认识react
  • 原文地址:https://www.cnblogs.com/qianyukun/p/6489161.html
Copyright © 2011-2022 走看看