2

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

I am using NativeScript for angular mobile app development. I have a login page that renders in webview and once app has the token, app then redirects to other native components.

My problem is: Screen renders fine for the first time and when user clicks on any of the text field, key board appears but when user presses Android Back button to hide the keyboard it shows the whitespace in top and bottom of the page.

Based on suggestions available on above threads, I have tried setting the padding and marging to 0. and

<meta name="viewport" content="target-densityDpi=device-dpi, width=device-width, height=device-height, initial-scale=1">
Narendra
  • 4,514
  • 2
  • 21
  • 38
  • Is it when you focus on a textfield inside webview? I'm unable to reproduce the issue, can you update the [Playground example](https://play.nativescript.org/?template=play-tsc&id=kGQOLG) so we can see the issue. – Manoj Nov 23 '18 at 06:36
  • It is when we press the back button to dismiss the keyboard, try to have some background color for body in html. will update the playground soon – Narendra Nov 23 '18 at 06:38
  • That's exactly what I tried and I was using Android 8. – Manoj Nov 23 '18 at 06:39
  • Thanks Manoj, that playground actually helped me. Looks Like my webview was inside a GridLayout and setting the height of that layout to 100% fixed the issue. – Narendra Nov 26 '18 at 00:10

1 Answers1

0

Thanks for the Playground Manoj. It looks like there was percentage height and width in html page and everytime user moves out from html page it re adjusts itself to available space and sometimes squeezes as well.

I was using the webview inside the GridLayout and setting the height and width 100% to that GridLayout solved my problem.

Narendra
  • 4,514
  • 2
  • 21
  • 38