Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android WebView not respecting scaling percentage

I have a WebView which I'm trying to have scale to a certain percent on loading the page. The iPhone version of this software uses the HTML meta-tag:

<meta name="viewport" content="width=320, initial-scale=0.95, maximum-scale=2.0, user-scalable=1">

Since Android's WebView doesn't seem to respect that tag I hard-coded the percent using setInitialScale(). However, the WebView is just flat-out ignoring this method call. No matter what number I put in there it shows at 100%.

Ideas?

Update: It's not working in the emulator, on my Droid (Motorola), or on my G1 (HTC).

like image 790
Jeremy Logan Avatar asked Jun 11 '10 19:06

Jeremy Logan


1 Answers

did you enable the zoom support for your webview?

    WebSettings webSettings = mywebView.getSettings();
    webSettings.setSupportZoom(true);       
like image 176
Jorgesys Avatar answered Oct 18 '22 10:10

Jorgesys