可以捏合放大cordova [英] Is it possible to pinch to zoom in cordova

查看:156
本文介绍了可以捏合放大cordova的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这方面没有很多资料,我所能找到的一点是非常模糊和无益的。我想要一个页面在我的cordova / phonegap应用程序有一个图像,可以压缩放大和平移。

There is not a lot of information on this, and the little that I have been able to find is very vague and unhelpful. I imply want a page in my cordova/phonegap app to have an image that can be pinched on to zoom in and pan around. Is this possible and if so, How do I do it?

推荐答案

在此行之后的本机代码

super.loadUrl(Config.getStartUrl());

添加此

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

您需要使用本地部分

import android.webkit.WebSettings;

在您要缩放的页面中,添加

And in the page you want to zoom, 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 the whole page with pinch. Everything inside that page will be zoomed.

这篇关于可以捏合放大cordova的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆