How do you disable all touch events in an Android WebView (or scrolling in particular)? I would like the activity to handle all touch events.
mWebView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } });
禁用a上的所有触摸事件,WebView
因为触摸侦听器在默认触摸行为之前执行WebView
.通过返回true
事件被消耗并且不会传播到WebView
.
使用android:clickable="false"
不会禁用触摸事件.