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

[Bug] Image in ScrollView causes content to truncate at end on Android #13398

Open
@IMLizKing

Description

@IMLizKing

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

  1. Start with a new Mobile App (Xamarin.Forms) project, using the Blank template, targeting Android
  2. Make sure it builds (this isn't always the case)
  3. Wrap the MainPage in a ScrollView and add enough content to make it scroll vertically
  4. Add some sort of image to the content as well (e.g.
  5. 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:
Screenshot_1610581530
Scrolled down (no image:
Screenshot_1610581503
Top with image:
Screenshot_1610581546
Scrolled down with image:
Screenshot_1610581549

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions