scrollView.setOnScrollChangeListener

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
        @Override
        public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
            Log.i("iTag.scrollY", String.valueOf(scrollY));
            Log.i("iTag.oldScrollY", String.valueOf(oldScrollY));
            if (scrollY < 0 && oldScrollY < 0) {
                textView.setText("");
                doGet();
            }
        }
    });
}

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注