我正在使用CLI3.0 (CLI)构建一个PhoneGap应用程序。
我也在使用jQuery移动版。我面临着允许特定页面“用户可伸缩”的问题。
元视口为
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0, user-scalable=yes">在移动浏览器上查看它时效果很好,但在PhoneGap应用程序中它不允许缩放。
有什么帮助吗?
发布于 2013-09-23 17:45:03
显然,Phonegap(安卓)在WebView中打开index.html,如果你想要扩展,那么你必须启用SupportZoom。在MainActivity中,添加代码:
public void onCreate(Bundle savedInstanceState) {
CookieManager.setAcceptFileSchemeCookies(true);
super.onCreate(savedInstanceState);
super.setIntegerProperty("loadUrlTimeoutValue", 60000);
super.loadUrl("file:///android_asset/www/index.html");
//Enable zoom in WebView
WebSettings settings = super.appView.getSettings();
settings.setBuiltInZoomControls(true);
settings.setSupportZoom(true);
}https://stackoverflow.com/questions/18954973
复制相似问题