我有一个(简单的)网页打包在phonegap 应用程序中。如果我启动应用程序,它会以纵向显示页面,横向页面宽度。所以文本从左下到左上开始。右侧有一个空白,页面应该在此处结束。
这是我所看到的:
在我的中支持的方向是横向左和右...-Info.plist
:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
在我的 iPad 上,我锁定了屏幕旋转。启动图像在横向显示正确。
该页面被设计成适合具有固定尺寸的横向。这是我的视口:
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
并且页面具有正确的横向宽度,但它被翻转了。我可以上下滚动。应用程序启动后,ipad 状态栏从顶部跳到左侧。
UPDATE
我仅将目标设备更改为 iPad,并仅允许方向为横向左,现在状态栏位于所需的顶部。页面还在翻...我也尝试过做一个简单页面版本 https://stackoverflow.com/questions/10999435/phonegap-ipad-no-rotation-at-all这应该轮换那些不起作用的东西。
Update 2
In Classes/MainViewController.m
I have:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}