Phonegap Landscape App; 然而,高度是肖像高度

Red*_*dox 2 height ios cordova

快速提问,我认为对于那些知道它是如何工作的人来说这应该是非常简单的(HTML5应用程序构建对我来说是新的).

我正在使用Phonegap来构建应用程序,但问题是,从phonegap构建的默认设置是面向纵向的.至少,这就是它的样子.当我在ipad上测试应用程序时,宽度调整得很好,因为某种原因,高度比身体的实际内容要大.我把它缩小到这条线:

当我删除height = device-height时,它工作正常.换句话说,我在那里得到了错误的设备高度.在横向上,我是否需要切换到height =设备宽度或其他什么?因为这看起来很奇怪,我希望我的身高会根据方向而改变.

A. *_*ães 5

我认为下面的代码可以解决您的问题.你需要使用

<meta name="viewport" content="width=device-width, initial-scale=1">.
Run Code Online (Sandbox Code Playgroud)

而这个结构

<!DOCTYPE html> 
<html> 
<head> 
<title>Page Title</title> 

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

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js">
</script>
</head> 

<body> 
...content goes here...
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

查看有关JQM页面剖析的更多信息