Can I pinch to increase the cordova?

There is little information about this, and not only can I find it, it is very vague and useless. I want the page in my cordova / phonegap app to have an image that you can pinch to zoom and pan. Is this possible, and if so, how to do it?

0
source share
1 answer

In native code immediately after this line

super.loadUrl(Config.getStartUrl()); 

Add this

 WebSettings settings = super.appView.getSettings(); settings.setBuiltInZoomControls(true); settings.setDisplayZoomControls(true); settings.setSupportZoom(true); 

You will need it in the native part

 import android.webkit.WebSettings; 

And on the page you want to enlarge, add this

 <meta name="viewport" content="user-scalable=yes,initial-scale=1, maximum-scale=5, minimum-scale=0.25/> 

This will allow you to zoom in on the entire page. Everything inside this page will be enlarged.

+2
source

Source: https://habr.com/ru/post/969641/


All Articles