我正在开发基于 android sdk 和 Eclipse 的 Phonegap 应用程序。只是采用了默认代码并添加了<meta>
可扩展性,但它不允许我在 Android SGS2 设备中放大或缩小。(没有在 iPhone 上检查,因为我没有。)
代码如下:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport"
content="user-scalable=yes" />
<!--<meta name="viewport"
content="user-scalable=yes,
initial-scale=1,
maximum-scale=4,
minimum-scale=1,
width=device-width,
height=device-height,
target-densitydpi=device-dpi" />
-->
<title>First App</title>
<script src="cordova-2.2.0.js"></script>
<script>
function onLoad(){
document.addEventListener("deviceready",
onDeviceReady, true);
}
function onDeviceReady(){
navigator.notification.alert("PhoneGap is working!!");
}
</script>
</head>
<body onload="onLoad();">
<h1>Welcome to PhoneGap</h1>
<h2>Edit assets/www/index.html</h2>
</body>
</html>