键盘消失后 Android Webview 中不需要的顶部和底部白色 Space

Unwanted Top and Bottom White Space in Android Webview after keyboard disappears

References SO Questions: remove-unwanted-white-space-in-webview-android and android-webview-has-extra-white-space-at-the-bottom

我正在使用 NativeScript 进行 angular 移动应用程序开发。我有一个在 webview 中呈现的登录页面,一旦应用程序拥有令牌,应用程序就会重定向到其他本机组件。

我的问题是:屏幕第一次呈现良好,当用户点击任何文本字段时,键盘出现,但当用户按下 Android Back 按钮隐藏键盘时显示页面顶部和底部的空白。

根据上述线程的建议,我尝试将 padding 和 marging 设置为 0。 和

<meta name="viewport" content="target-densityDpi=device-dpi, width=device-width, height=device-height, initial-scale=1">

感谢 Playground Manoj。 html 页面中似乎有百分比高度和宽度,每次用户从 html 页面移出时,它都会重新调整自身以可用 space,有时也会挤压。

我在 GridLayout 中使用 webview 并将高度和宽度 100% 设置为该 GridLayout 解决了我的问题。