简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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