Avoid that EditText consumes click event

前端 未结 2 1868
无人共我
无人共我 2021-01-04 12:11

Normally it\'s enough to set focusable, focusableInTouch + clickable to false. But here it does not work.

I want the parent

相关标签:
2条回答
  • 2021-01-04 12:53

    Late, but maybe somebody else needs this info. After setting focusable, focusableInTouch + clickable to false, add this in your java code:

        editText.setMovementMethod(null);
        editText.setKeyListener(null);
    

    Don't forget to save those values to restore them later:

        mMovementMethod = mEditText.getMovementMethod();
        mKeyListener = mEditText.getKeyListener();
    
    0 讨论(0)
  • 2021-01-04 12:53

    You should use ViewGroup.onInterceptTouchEvent(MotionEvent)

    This method is to intercept all touch screen motion events

    0 讨论(0)
提交回复
热议问题