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

时间:2018-11-23 04:06:49

标签: webview nativescript nativescript-angular

  

参考文献SO问题:remove-unwanted-white-space-in-webview-android   和android-webview-has-extra-white-space-at-the-bottom

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

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

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

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

1 个答案:

答案 0 :(得分:0)

感谢游乐场Manoj。 似乎html页面中的高度和宽度都有百分比,并且每次用户从html页面移出时,它都会自动调整为可用空间,有时还会挤压。

我正在GridLayout中使用Web视图,并将高度和宽度100%设置为GridLayout解决了我的问题。