0

当发现 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;
}
4

1 回答 1

0

使用这个:也添加那个

wv.getSettings().setSupportZoom(true);
wv.getSettings().setBuiltInZoomControls(true);
于 2013-09-12T13:00:00.340 回答