'Xamarin WebView Resize not going back to fullscreen?

I have this issue on Xamarin WebViews where the Native Keyboard covered up the inputs (WindowSoftInputModeAdjust.Pan). NOTE: This is only an issue for Android, not iOS This isn't really an issue on the shown login screen so we didnt put much thought into it. However now we have other pages where this is more of a problem (keyboard covering the inputs).

So after a lot of research and testing I figured that it should be WindowSoftInputModeAdjust.Resize that does the trick. This seems to be the correct thing to do and always the answer to these questions.

        Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);
        MainPage = new HybridWebViewPage();

BUT - nobody seems to have the issue I'm getting?

This is my expectation of Resize

  1. Fullscreen
  2. Click input, show keyboard and resize screen
  3. Back to fullscreen

Expecation

But what is actually happening is on Step 3 it refuses to go back to fullscreen? Reality

I'm quite stumped by this, I saw about 30 issues with getting resize even working and tried everything - but nobody has had the issue that it doesn't go back to fullscreen so not sure how to fix it. I had the following, which I read stops resize from working - but removing it does nothing.

    <item name="android:windowFullscreen">true</item>

I work at an app agency and we have not found a solution to this on any of our apps other then to try design them to not have inputs at the bottom of pages which imo is a bad workaround for something that should work. Please help me solve this..



Solution 1:[1]

Try to add the following code into AndroidManifest in Android project .

 android:windowSoftInputMode="adjustPan|stateAlwaysHidden"

And remove the following code from forms project .

Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ColeX - MSFT