Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable pinch zoom in WebView?

I'm building an app that displays some content in a WebView. I'm styling this content to fit the screen and no zooming is needed. Is there a way do turn off the zooming features of a WebView?

like image 897
thedude19 Avatar asked Feb 17 '11 01:02

thedude19


People also ask

How do I enable pinch zoom?

In the Hardware and Sound window, under Devices and Printers, click Mouse. In the Mouse Properties window, click the Multitouch Gestures tab. On the Multitouch Gestures tab, locate the Enable Pinch Zoom check box. Once the box is either checked or unchecked, click OK.

How do you turn off zoom on input focus on mobile devices?

In order to stop mobile browser to zoom in on focus on input field we just have to change font size for input field. The reason why mobile browser is zooming in is to make text larger so that user can read it.


1 Answers

wv.getSettings().setSupportZoom(false);

Is what you want. with setBuiltInZoomControls it won't disable multitouch zooming but this does. Although its worth noting that depending on the device zooming may be disabled by default. I have an app with a WebView in it and on my HTC g2 it doesn't allow me to zoom at all. But the exact same code will allow zooming on Galaxy Tablet.

like image 136
FoamyGuy Avatar answered Oct 15 '22 14:10

FoamyGuy