有没有办法通过 CSS 或 jQuery 在移动设备上控制 window 高度?

Is there a way to control window height on mobile with CSS or jQuery?

我在移动浏览器中遇到 window 高度问题。 我正在使用 css 100vw 但它并不总是准确的 - 特别是当浏览器显示附加功能时 - 我的意思是顶部的导航栏或底部的功能按钮。

简而言之 - 他们去掉了 window 的大小,但它并不是指精确计算的 window 大小。

我正在上传视频,以便最好地了解我正在谈论的内容: As you can see here - where i'm opening chat window the window height is changing during keyboard show-up - but window itself does not change the size - when i enter it second time - the window height is changing - how i can get controll over it?

Here when the bottom stripe is added the height of the chat window is ok - it's computed by CSS height:calc(100vh - px) and it's work But when stripe is gone - window height remain the same - so the height is much lower

如何获得具有此 window 附加功能的手机 window 的高度? (添加了地址栏、功能按钮或键盘?)。

(电影来自 iPhone iOS - 在 Android 上似乎一切正常)

不要使用 100vw,请尝试使用 100%。像这样:

height:100%