简体   繁体   English

PhoneGap-在打开键盘的情况下获取设备高度

[英]PhoneGap - Get device height with keyboard open

Hello I want to know the device height, it's working good with: 您好,我想知道设备的高度,它可以很好地与以下设备配合使用:

1) window.innerHeight
2) window.outerHeight
3) device.height

The problem that if the keyboard is open it's not return the original height. 问题是,如果打开键盘,则不会返回原始高度。

How should I get the full screen height in pixel ? 如何获得以像素为单位的全屏高度? That wouldn't be depends on changes like keyboard and etc. 那不会取决于键盘等的变化。

Thanks! 谢谢!

See the height and width of device is not going to change any point of time. 看到设备的高度和宽度不会改变任何时间点。 So store the height and width of the device at app initialization time. 因此,请在应用初始化时存储设备的高度和宽度。 And use them every time you need. 并在每次需要时使用它们。 I hope it will help. 希望对您有所帮助。

Note : If you are also working with both device orientations like portrait and landscape, you can store both. 注意:如果同时使用纵向和横向两个设备方向,则可以同时存储两者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM