Get viewport height when soft keyboard is on

后端 未结 7 1815
梦如初夏
梦如初夏 2021-01-31 08:45

I\'ve been trying to make this work for days now, with no luck, so I thought I\'d share info and maybe someone comes up with a solution.

I want to get the exact viewport

7条回答
  •  心在旅途
    2021-01-31 09:38

    This solution is a bit convoluted, but it might work...

    1. Detect whether or not the keyboard is active.
    2. Grab the viewport width/height
    3. Subtract the height of the keyboard.

提交回复
热议问题