NestedScrollView 滚动监听是否到底部

Kornan
2020-09-11 / 0 评论 / 237 阅读 / 正在检测是否收录...
nestedScrollView.setOnScrollChangeListener(
            NestedScrollView.OnScrollChangeListener { v, scrollX, scrollY, oldScrollX, 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).measuredHeight - v.measuredHeight) {
                    Log.i(TAG, "BOTTOM SCROLL")
                }
            })
0

评论

博主关闭了当前页面的评论