ListView 禁止滑动和点击

public boolean dispatchTouchEvent(MotionEvent ev) {
        if(oneTouchDesable){
            
            if(!contains((int)ev.getX(), (int)ev.getY())){
                if(ev.getAction() == MotionEvent.ACTION_UP){
                    oneTouchDesable = false;
                }else if(ev.getAction() == MotionEvent.ACTION_DOWN){
                    if(touchStatusListener!=null){
                        touchStatusListener.oneTouchDesable();
                        lastX =-1;
                    }
                }
            }
            return true;
        }
        return super.dispatchTouchEvent(ev);
    }

重新listView的

dispatchTouchEvent 事件根据条件屏蔽到响应的触摸事件就可以实现ListView的滑动和点击事件屏蔽
原文地址:https://www.cnblogs.com/liyangguang/p/4057037.html