Answer the question
In order to leave comments, you need to log in
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? Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question