[Bug] Image in ScrollView causes content to truncate at end on Android #13398
Description
Description
I find that if I put an Image into a stacklayout contained in a scrollview (within a ContentPage) that the bottom of the scrollview content will be truncated and only show the background color of the scrollview in the space that should display the content. Not co-incidentally, the amount of blank space equals the height of the rendered image. And if you request a height for the image (ala HeightRequest) the problem goes away.
Steps to Reproduce
- Start with a new Mobile App (Xamarin.Forms) project, using the Blank template, targeting Android
- Make sure it builds (this isn't always the case)
- Wrap the MainPage in a ScrollView and add enough content to make it scroll vertically
- Add some sort of image to the content as well (e.g.
- Run on Android (things seem fine on iOS and UWP) and notice the bottom of the scrollview content being blank
Expected Behavior
Seeing all the content contained within the ScrollView.
Actual Behavior
On Android, the content is truncated but the appropriate amount of space is still there.
Basic Information
- Version with issue: 5.0.0
- Last known good version: Unknown
- Platform Target Frameworks:
- Android: 5.1
Environment
Using latest VS 2019 with stable Xamarin 5.0
Build Logs
Not a build problem..
Screenshots
Top without image:
Scrolled down (no image:
Top with image:
Scrolled down with image:
Reproduction Link
Here's a github repository with the base VS 2019 project with the the main XAML modified to demonstrate the bug.
Workaround
Specify a height (via HeightRequest) and things work properly, but the Image size doesn't expand to the fill the space unless you get the height exactly right (and the native image height varies per platform).