Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] ScrollView in AbsoluteLayout: unexpected extra space below the content #10315

Open
ampersd opened this issue Apr 13, 2020 · 5 comments

Comments

@ampersd
Copy link

ampersd commented Apr 13, 2020

Description

When we put ScrollView inside AbsoluteLayout with constraints AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1.0,1.0" to fill all screen space and then put some layout content inside ScrollView, and set it's VerticalOptions="EndAndExpand" then on Android it will works as expected - content area will be in the bottom of the screen and will slide up only when we open keyboard on the smartphone, but on the iOS there is some unexpected extra space beneath the content area, so content doesn't stick to the bottom of the screen - instead we can scroll it.

Steps to Reproduce

  1. Create AbsoluteLayout
  2. Put inside it ScrollView with AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1.0,1.0"
  3. Put inside some element, for example BoxView, set it's VerticalOptions="EndAndExpand"

Expected Behavior

Content Area should be stick to the bottom of the screen. Sliding up only when we open the keyboard.

Actual Behavior

On Android works just fine.
On iOS content area doesn't stick to the bottom, there are extra space after it inside scrollview

Basic Information

  • Version with issue: Xamarin Forms v4.5.0.617
  • IDE: Visual Studio Community 2019
  • Platform Target Frameworks:
    • iOS: iOS 13.3

Reproduction Link

ScrollViewBugiOS.zip

@GiampaoloGabba
Copy link
Contributor

GiampaoloGabba commented Apr 15, 2020

Maybe it's related to #5098
I have proposed a fix for this here: #7198

Having the ability to control the ContentInsetAdjustmentBehavior with a Platform Specific should fix all of the extra spaces problems in iOS.

I'm ready to submit a pull request but i dont know if the forms team is ok with it (7198 is in "Under consideration")

@ampersd
Copy link
Author

ampersd commented Apr 17, 2020

@GiampaoloGabba
added CustomRenderer (hope I didn't make some stupid mistake in the code) - didn't help, no effect

image

updated solution, with custom renderer:

ScrollViewBugiOS.zip

@GiampaoloGabba
Copy link
Contributor

GiampaoloGabba commented Apr 17, 2020

sorry, the solution i posted will not show the TextField when scrolling, nevermind :)

@jsuarezruiz
Copy link
Contributor

Seems to be the same (or at least related) as #5098

@jsuarezruiz jsuarezruiz moved this from New to Ready For Work in Triage Apr 21, 2020
@jsuarezruiz jsuarezruiz added e/2 🕑 2 and removed s/unverified New report that has yet to be verified labels Apr 21, 2020
@samhouts samhouts added this to To do in Other Ready For Work Apr 21, 2020
@samhouts samhouts removed this from Ready For Work in Triage Apr 21, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts added this to To do in vNext+1 (5.0.0) Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@demoh2019
Copy link

I get the same error when ScrollView is inside other layouts (grid, StackLayout)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests

5 participants