当发现 onTouchEvent 缩放不起作用时,我有类扩展 webview。
@Override
public boolean onTouchEvent(MotionEvent event) {
super.cancelLongPress();
int action = event.getAction();
if (action == MotionEvent.ACTION_DOWN
|| action == MotionEvent.ACTION_UP) {
super.onTouchEvent(event);
} else if (action == MotionEvent.ACTION_CANCEL
|| action == MotionEvent.ACTION_MOVE) {
MotionEvent e = MotionEvent.obtain(event);
e.setAction(MotionEvent.ACTION_CANCEL);
super.onTouchEvent(e);
}
gestureDetector.onTouchEvent(event);
super.cancelLongPress();
return true;
}