我正在使用 PhoneGap 3.0 (CLI) 来构建 PhoneGap 应用程序。
我也在使用 jQuery Mobile。我面临允许特定页面“用户可扩展”的问题
元视口是
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0, user-scalable=yes">
在移动浏览器上查看时效果很好,但在 PhoneGap 应用程序中它不允许缩放。
有什么帮助吗?
我正在使用 PhoneGap 3.0 (CLI) 来构建 PhoneGap 应用程序。
我也在使用 jQuery Mobile。我面临允许特定页面“用户可扩展”的问题
元视口是
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0, user-scalable=yes">
在移动浏览器上查看时效果很好,但在 PhoneGap 应用程序中它不允许缩放。
有什么帮助吗?
显然,Phonegap(Android) 在 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);
}