Skip to content

[Android] Invisible ImageButton Padding Broken #25201

@aheubusch

Description

@aheubusch

Description

On Android setting a Padding on a not visible ImageButton produces incorrect results when it becomes visible.
Expected
Image

Actual
Image

Steps to Reproduce

Clone repo, start and click on button "click me". Observe incorrect ImageButton.
or

  1. Add an ImageButton like so:
<ImageButton
    Background="Red"
    Padding="50"
    IsVisible="False"

    Source="dotnet_bot.png"
    HeightRequest="185"
    x:Name="imageButton"
    />
  1. Make the ImageButton visible in a button click event (imageButton.IsVisible = true;).

Link to public reproduction project repository

https://github.com/aheubusch/MauiAndroidImageButtonPadding

Version with bug

8.0.91 SR9.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

Nope :(

Relevant log output

No response

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