T
T
TheMatiss2016-02-22 02:58:01
Android
TheMatiss, 2016-02-22 02:58:01

Webview: How to disable double tap zoom?

Hello.
We have a webview. When you double tap on the screen, the scale increases. With a repeated double tap, it returns.
The viewport meta tag of the page itself looks like it shouldn't be:

<meta name="viewport" content="width=700, user-scalable=no, maximum-scale=1.0" />
How to avoid this so that no impacts on the screen affect the scale?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Goryachkin, 2016-02-22
@abaddon65

You can do it like this:
Then the truth will turn off any zoom. Or you can use the implementation of the GestureDetector.OnDoubleTapListener interface :

...
    @Override
    public boolean onSingleTapConfirmed(MotionEvent e) {
        return false;
    }

    @Override
    public boolean onDoubleTap(MotionEvent e) {
        //Тут вернем true, тем самым игнорим двойной клик
        return true;
    }

    @Override
    public boolean onDoubleTapEvent(MotionEvent e) {
        return true;
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question