我正在開發基於android sdk和Eclipse的Phonegap應用程序。 只是採取了默認的代碼,並添加了<meta>
的可擴展性,但它不允許我放大或縮小Android SGS2設備。 (沒有檢查了iPhone,因爲我沒有。)viewport - user-scalable = yes不起作用
的代碼如下:
<!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>