html – Phonegap页面旋转错误,在横向模式下显示为纵向

html – Phonegap页面旋转错误,在横向模式下显示为纵向,第1张

概述我有一个(简单的)网页包装在一个phonegap应用程序中.如果我启动应用程序,它将以纵向方向显示页面,并显示横向页面宽度.所以文本从左下到左开始.在右边,我有一个页面应该结束的空白. 这就是我所看到的: 支持的方向在我的…- Info.plist中左右横向: <key>UISupportedInterfaceOrientations</key><array> <string>UIInt 我有一个(简单的)网页包装在一个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并允许定向到横向左侧,现在状态栏位于需要的顶部.页面仍然转向…我还尝试制作一个simple page version,它应该旋转不起作用的东西.

更新2

在Classes / MainVIEwController.m中我有:

- (BOol)shouldautorotatetoInterfaceOrIEntation:(UIInterfaceOrIEntation)interfaceOrIEntation{    // Return YES for supported orIEntations    return (interfaceOrIEntation == UIInterfaceOrIEntationPortrait);}
解决方法 您可以检查根控制器 – shouldautorotatetoInterfaceOrIEntation,允许旋转某个方向.希望能帮助到你.

例如,在Classes / MainVIEwController.m中返回true:

- (BOol)shouldautorotatetoInterfaceOrIEntation:(UIInterfaceOrIEntation)interfaceOrIEntation{    // Return YES for supported orIEntations    //return (interfaceOrIEntation == UIInterfaceOrIEntationPortrait);    return true;}
总结

以上是内存溢出为你收集整理的html – Phonegap页面旋转错误,在横向模式下显示为纵向全部内容,希望文章能够帮你解决html – Phonegap页面旋转错误,在横向模式下显示为纵向所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1079964.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存