-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ButtonImage width not sizing correctly #14346
Copy link
Copy link
Closed
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
In Android, ButtonImages incorrectly resize the width of the button to match the original width of the image.
The following code demonstrates the problem:
<Frame HeightRequest="50" Padding="0">
<ImageButton
BackgroundColor="Transparent"
BorderColor="Red"
BorderWidth="2"
Aspect="AspectFit"
HorizontalOptions="Center"
VerticalOptions="Center"
Source="dotnet_bot.png" />
</Frame>This generates the following result. You can see that the ImageButton is wider than it should be (the red outline). It seems this width is related to the width of the image asset (dotnet_bot).
Steps to Reproduce
See description above
Link to public reproduction project repository
n/a
Version with bug
6.0.312
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
all
Did you find any workaround?
A workaround is to use a normal Image with a tap gesture like this:
<Image
Source="icon_offers.png">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding GotoOffers}" />
</Image.GestureRecognizers>
</Image>Relevant log output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
