xamarin/Xamarin.Forms

[Bug] Image on Button or ImageButton distorts when swapped

Open

#6,937 opened on Jul 19, 2019

 (2 comments) (3 reactions) (0 assignees)C# (1,926 forks)batch import
a/imagebuttona/layoute/3 :clock3:help wantedp/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

When swapping out the Source Image on the attached project the image will occasionally distort. If you click it enough times it'll return back to normal.

Steps to Reproduce

  1. Run attached project
  2. click on the heart a few times and you will see sometimes it distorts

In the sample if you delete the Frame above the ImageButton then the distortion no longer occurs

Expected Behavior

The image should always stay the same height/width

Actual Behavior

The image when changing stretches and occasionally doesn't return to normal

Basic Information

  • Version with issue: 4.3
  • Last known good version: I tested as far back as 3.4 and the issue still presented itself there
    • Android: API 23

Screenshots

image

Reproduction Link

ImageSizesWeirdWhenChanged.zip

Contributor guide