gpt4 book ai didi

android - jQuery Mobile/PhoneGap 应用程序在 Android 设备上显示非常宽,但在 WP7 模拟器中却没有

转载 作者:太空宇宙 更新时间:2023-11-03 12:57:49 26 4
gpt4 key购买 nike

我使用 jQuery Mobile 和 PhoneGap 创建了一个移动应用程序。当我在 Windows Phone 7 模拟器上运行该应用程序时,它以预期的宽度显示。 http://post.robfine.com/jqueryapponwindowsphoneemulator.png

但是,当我创建一个 apk 并在我的 android 设备上测试该应用程序时,它以更大的宽度显示。 http://post.robfine.com/jquerymobileappsowideandroid.jpg

根据我的研究,所有内容都指向我已经处理过的视口(viewport)元标记。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Circle of Death 2.0</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css" />
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.3.1.min.js"></script>
<script type="text/javascript" src="cordova-2.7.0.js"></script>
<script type="text/javascript" src="js/GameLib.js"></script>
</head>
<body>
<div class="app" id="deviceready">
<div data-role="page" id="page1">
<div data-role="content">
<div>
<img src="img/CircleOfDeath2Title.png" alt="Circle of Death" width="100%" />
</div>
<div style="text-align: center; padding: 10px;">
<img src="img/cardback.png" alt="Card Deck" onclick="DrawCard();" id="CardDeck" />
</div>
<div>
<h2 id="RuleTitle" style="margin:0px;"></h2>
</div>
<div>
<span id="Directions"></span>
</div>
</div>
</div>
</div>
</body>
</html>

有没有其他人在使用 PhoneGap 和 jQuery Mobile 时遇到过这个问题?提前致谢。

最佳答案

你的 viewport 标签中有很多东西,我的 phonegap 应用程序在 android 中运行良好,只需使用以下 viewport 标签:

<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">

关于android - jQuery Mobile/PhoneGap 应用程序在 Android 设备上显示非常宽,但在 WP7 模拟器中却没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16862259/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com