简体   繁体   中英

Pinch to zoom cordova

how do you implement pinch to zoom for a cordova android project

I have a iframe in which I am loading my src and I want to implement pinch to zoom on the iframe because it is occupying the whole screen

To be precise you can achieve pinch to zoom in two ways

  1. If you open the image in a native container which allows zoom and pinch - the performance is far better, here you might need a Cordova plugin which can do that for you, i found https://github.com/keensoft/FullScreenImage-Cordova-Plugin but i think it only opens up the image in full screen natively but doesnt allow pinch and zoom , you can try
  2. If you dont use a plugin which means the image is shown inside the webview, for which you either write code for touch events or simply use hammer.js which allows this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM