【发布时间】:2018-11-29 08:43:23
【问题描述】:
参考 SO 问题:remove-unwanted-white-space-in-webview-android 和android-webview-has-extra-white-space-at-the-bottom
我正在使用 NativeScript 进行 Angular 移动应用程序开发。我有一个在 webview 中呈现的登录页面,一旦应用程序拥有令牌,应用程序就会重定向到其他本机组件。
我的问题是:屏幕第一次呈现正常,当用户单击任何文本字段时,会出现键盘,但是当用户按下 Android Back 按钮隐藏键盘时,它会在顶部和底部显示空白页面。
根据上述线程提供的建议,我尝试将填充和边距设置为 0。 和
<meta name="viewport" content="target-densityDpi=device-dpi, width=device-width, height=device-height, initial-scale=1">
【问题讨论】:
-
当你专注于 webview 中的文本字段时?我无法重现该问题,您能否更新Playground example 以便我们查看该问题。
-
当我们按下后退按钮关闭键盘时,尝试在 html 中为 body 设置一些背景颜色。很快就会更新游乐场
-
这正是我尝试过的,我使用的是 Android 8。
-
感谢 Manoj,那个游乐场确实帮助了我。看起来我的 webview 在 GridLayout 内,并将该布局的高度设置为 100% 解决了这个问题。
标签: webview nativescript nativescript-angular