Bug 54980 - AdjustResize Not Working
Summary: AdjustResize Not Working
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-04-10 17:13 UTC by Hakan
Modified: 2017-06-16 22:04 UTC (History)
4 users (show)

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

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 Hakan 2017-04-10 17:13:22 UTC
When an entry in a scrollview gets focus and keyboard is shown, I expect that the window is resized and I can scroll through the scrollview. There is even the "AdjustResize" flag to force Android to do so. But neither using this flag in the Activity attribute nor in code using "Window.SetSoftInputMode(Android.Views.SoftInput.AdjustResize);" works. It is always in the AdjustPan mode.

I tried several workaraounds but they do not work across all versions of Android.

I am using FormsAppCompatActivity. You can try it with a simple contentpage-->scrollview-->entries layout in any version of Android.

I believe this is a bug, and an urgent one.
Comment 1 Jimmy [MSFT] 2017-04-11 14:51:53 UTC
To set the SoftInputMode in an Android Forms project, please use the platform specific feature introduced in Forms 2.3.3: https://developer.xamarin.com/guides/xamarin-forms/platform-features/platform-specifics/consuming/android/#Setting_the_Soft_Keyboard_Input_Mode
Comment 2 Hakan 2017-04-11 17:05:55 UTC
I just tried the platform specific feature now as per your guidance. It enabled scrolling but it has the side effect that the status bar became white and a blank section appeared between the status bar and the page that is the same height as the status bar and has the background color I set for the status bar.
Comment 3 Hakan 2017-04-12 21:29:59 UTC
In addition to the side effect I mentioned above, one other side-effect I noticed is that when you navigate back while the keyboard is open, the navigated page also becomes resized as if the keyboard is open, although the keyboard is automatically closed when the user taps the software navigate back button.
Comment 4 Hakan 2017-04-17 13:13:18 UTC
Do you have any recommendations for the problems I mentioned above?
Comment 5 Samantha Houts [MSFT] 2017-04-17 18:47:46 UTC
@Hakan: The issue mentioned is on our radar, and a fix is under review.

https://github.com/xamarin/Xamarin.Forms/pull/552
Comment 6 Hakan 2017-04-17 19:37:24 UTC
As far as I understand, the fix in the link addresses the first issue. Is there any work in progress to adress the second issue I mentioned, the erroneous resizing on back navigation?
Comment 7 Jimmy [MSFT] 2017-06-16 22:04:28 UTC
Fixes for the status bar issue and the resizing issue have been merged and will be available in a future release.

https://github.com/xamarin/Xamarin.Forms/pull/892
https://github.com/xamarin/Xamarin.Forms/pull/927