-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
Hello, and thank you for this awesome framework.
I've noticed a bug where ImageButtons for Android does not correctly set their Padding. I first thought it happened every time you draw a ImageButton, but that was not the case. It happens whenever you change the IsVisible property, which in many cases people are I presume.
In the follow example I have a ImageButton with the dotnet_bot as source and a red background. I've set the Padding to 50, which should make the bot smaller inside the button. This works the first time the app loads, but once I change the IsVisible (using the Switch) it ignores the Padding.
Screen.Recording.2023-10-13.at.13.56.55.mov
Steps to Reproduce
- Clone this repository.
- Select Android
- Run the code
- Observe the
ImageButtonhas the correct padding once it loads. - Observe the
ImageButtonnot having the correct padding when you tap theSwitch.
Link to public reproduction project repository
https://github.com/haavamoa/MauiApp/tree/task/hmo-imagebutton-padding-android
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
The way to get around this the issue where IsVisible is flipped is to make sure to update the padding after the IsVisible has changed:
Here is our fix, where we ship a wrapping ImageButton class.
Relevant log output
No response