phonegap 2.2方向更改不调整应用程序

在以前版本的Phonegap中,我没有这个问题。 但在2.2中,当我改变方向时,它不更新uiwebview

phonegap默认不支持横向视图吗? 你如何处理这个?

问题

这不是WebView获取更新的问题,而是在index.html文档头中的meta标签。

 <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" /> 

删除不必要的height=device-height一切正常

 <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" /> 

支持景观

要添加Stephan的答案,如果在方向更改时需要做特别的事情,可以将callback函数设置为:

window.onorientationchange

我也有同样的问题,在IOS手机….

只要去更新x-code项目文件(IOS应用程序目标)更改或更新支持界面的方向,并检查它的所有方向。

这很好…

 window.addEventListener( "orientationchange", function() { // Announce the new orientation number location.reload(); }, false );