版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/soha_dong/article/details/80832176
重写onTouchEvent方法,在移动的过程中拦截触摸事件的传递
@Override
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getAction()) { case MotionEvent.ACTION_MOVE: if (.....) { //消费此事件 super.onTouchEvent(ev); return true; } break; } return super.onTouchEvent(ev); }