Disable the touch events for all the views

前端 未结 13 1380
暗喜
暗喜 2020-11-28 06:53

What\'s the best way to disable the touch events for all the views?

相关标签:
13条回答
  • 2020-11-28 07:20

    Use this. returning true will indicate that the listener has consumed the event and android doesn't need to do anything.

    view.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            return true;
        }
    });
    
    0 讨论(0)
提交回复
热议问题