Bug 39302 - White box appears when WebView is scaled at runtime
Summary: White box appears when WebView is scaled at runtime
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-02 18:10 UTC by Cody Beyer (MSFT)
Modified: 2017-03-09 17:37 UTC (History)
4 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments
Samples (100.45 KB, application/zip)
2016-03-02 18:10 UTC, Cody Beyer (MSFT)
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Cody Beyer (MSFT) 2016-03-02 18:10:52 UTC
Created attachment 15226 [details]
Samples

# Description

The two attached sample apps demonstrate an issue where, while repositioning a WebView, a white box will overlay the entire view

# Samples

Xamarin.Android: Attached as Test_android_native.zip

Xamarin.Forms: Attached as Test_forms.zip

# Video

https://www.dropbox.com/s/bjvy924jtf5kvlh/whiteboxforms.mov?dl=0

# Steps to Reproduce

1. Download Forms sample
2. Open in Xamarin Studio
3. Deploy to Android
4. Type string within web view
5. press the plus button until the web view is hidden

# Expected Results

The WebView should disappear below keyboard

# Actual Results

A white box appeared

# Verisons

=== Xamarin Studio ===

Version 5.10.2 (build 56)
Installation UUID: ae0fa433-e78e-4353-a756-7b47170e264a
Runtime:
	Mono 4.2.2 (explicit/996df3c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402020030

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: 6.0.1.10 (Business Edition)
Android SDK: /Users/codybeyer/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 7.2.1 (9548.1)
Build 7C1002

=== Xamarin.iOS ===

Version: 9.4.1.25 (Business Edition)
Hash: 962a050
Branch: master
Build date: 2016-01-29 16:59:11-0500

=== Xamarin.Mac ===

Version: 2.4.1.6 (Business Edition)

=== Build Information ===

Release ID: 510020056
Git revision: bb74ff467c62ded42b7b7ac7fdd2edc60f8647b0
Build date: 2016-01-26 16:24:41-05
Xamarin addins: 8b797d7ba24d5abab226c2cf9fda77f666263f1b
Build lane: monodevelop-lion-cycle6-c6sr1

=== Operating System ===

Mac OS X 10.11.3
Darwin clb-mbp.local 15.3.0 Darwin Kernel Version 15.3.0
	Thu Dec 10 18:40:58 PST 2015
	root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
Comment 1 Jason Smith [MSFT] 2016-03-11 10:35:02 UTC
This is related to the way that AppCompat backend uses AdjustPan and not AdjustReize. Currently there is no reasonable way of selecting the desired mode in forms (you desire the other mode in this case).

We are expanding our API to enable this however its not possible right this second.
Comment 2 Jason Smith [MSFT] 2016-03-11 10:36:46 UTC
I should say with some custom renderers and making sure to set the SoftInputMode and making sure the Window.DecoreView.SystemUiVisibility is properly set to enable the AdjustResize mode you can make this work. It's just more complex than we want.
Comment 3 Bartosz 2016-03-16 08:43:53 UTC
Jason, can you clarify your solution? 
I have tried using AdjustResize, and the white overlay does not appear, but in some cases the behaviour of AdjustPan is more appropriate. 

Also from the bug report maybe it is not clear, but this is not only an issue of scaling at runtime, but also if the size is fixed. If the view on top of the WebView is big enough such that the whole window needs resizing to make the keyboard appear, when the user starts typing in the WebView the white overlay appears, hiding the content of the text that he's trying to write.
Comment 4 Jason Smith [MSFT] 2016-03-16 09:54:03 UTC
Can you elaborate so I can make sure what Im testing is what you need? As much detail as possible (circles/arrows/images) is best here because catching every case is non-trivial and I want to make sure I dont misunderstand you.
Comment 5 Bartosz 2016-03-16 15:36:55 UTC
Sure. 
So let us consider just the attached test forms project. 
Just launch the app, and then click on the webview and start writing. It all works fine. 
Now dismiss the keyboard by pressing the back button (or simply restart the app).
Then press the plus button 4-5 times to make the webview go lower in the screen. Now, click on text in the webview, the keyboard gets pushed up and a white overlay covers the webview, and the text is no more visible. If you try to write something, the text will be written. In fact when you dismiss the keyboard the text that you wrote will be there, it was just hidden. 
Let me know if you need other details. Eventually I can make a video explaining the situation if needed
Comment 6 Bartosz 2016-04-04 12:47:21 UTC
I want to add a thing that I have discovered.
This problem is definitely related to AdjustPan. In fact if we set it in the Xamarin.Android project, by using  "Window.SetSoftInputMode(Android.Views.SoftInput.AdjustPan)", we have the same white overlay issue as in the Forms project.
Comment 7 Samantha Houts [MSFT] 2017-03-09 17:37:56 UTC
Good news! As of Xamarin.Forms 2.3.3, you can use a platform specific option to set the SoftInputMode to AdjustResize.

Please see https://blog.xamarin.com/bringing-platform-specific-functionality-to-xamarin-forms-apps/ for more information.

Thank you!