Android应用在onDeviceReady事件上返回无效大小(320x480),但几秒后大小变得正确.
我们怎样才能在一开始就获得正确的尺寸?或者是否有任何我可以获得正确尺寸的事件?
我正在使用此函数来获取大小:
function getWindowSizes() {
  var windowHeight = 0, windowWidth = 0;
  if (typeof (window.innerWidth) == 'number') {
      windowHeight = window.innerHeight;
      windowWidth = window.innerWidth;
      
  } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
      windowHeight = document.documentElement.clientHeight;
      windowWidth = document.documentElement.clientWidth;
      
  } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
     windowHeight = document.body.clientHeight;
     windowWidth = document.body.clientWidth;
  }
  return [windowWidth, windowHeight];
}
视口:
<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" />
使用Cordova 2.5.0.
UPD:
正如您在此屏幕截图中看到的那样,应用程序以较小的尺寸启动.即使是空的Cordova项目也是如此.我怎样才能解决这个问题?

谢谢!
| 归档时间: | 
 | 
| 查看次数: | 9607 次 | 
| 最近记录: |