我发现类扩展了webview,当发现onTouchEvent时缩放不起作用。
@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;
}
答案 0 :(得分:0)
使用此: 添加它
wv.getSettings().setSupportZoom(true);
wv.getSettings().setBuiltInZoomControls(true);