Skip to content Skip to sidebar Skip to footer

Cordova : How To Enable Viewport Zoom

I'm currently trying to enable native viewport zoom (like the native web zoom I mean) on Cordova Android (webview). Here's my viewport tag : Copy

put following in the onCreate method of your main Android Java File inside src/com/packagename directory:

super.appView.getSettings().setBuiltInZoomControls(true);
super.appView.getSettings().setDefaultZoom(ZoomDensity.MEDIUM); 
super.appView.getSettings().setSupportZoom(true);

also add following packages in your main java file:

import android.webkit.WebSettings; 
import android.webkit.WebSettings.ZoomDensity;

Hope this helps...

Post a Comment for "Cordova : How To Enable Viewport Zoom"