📜  kotlin scrollView 滚动监听器 - Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:33.482000             🧑  作者: Mango

代码示例1
scrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
    @Override
    public void onScrollChanged() {
        int scrollY = rootScrollView.getScrollY(); // For ScrollView
        int scrollX = rootScrollView.getScrollX(); // For HorizontalScrollView
        // DO SOMETHING WITH THE SCROLL COORDINATES
    }
});