Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button with image not scaling to HeightRequest on iOS #22306

Closed
PureWeen opened this issue May 9, 2024 · 2 comments · Fixed by #22476
Closed

Button with image not scaling to HeightRequest on iOS #22306

PureWeen opened this issue May 9, 2024 · 2 comments · Fixed by #22476

Comments

@PureWeen
Copy link
Member

PureWeen commented May 9, 2024

Description

Extension of #9734

Button with an image fails to correctly scale the source image to the size of the button this results in the full size image being displayed in Android and a skewed image in iOS

iOS
Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2022-08-29 at 17 43 58

Steps to Reproduce

Create a new example Maui App

Add the following line of xaml to MainPage.xaml

<Button
                ImageSource="dotnet_bot.png"
                Text="Im a happy button"
                HeightRequest="40"
                WidthRequest="200"/>

Run the solution, works correctly in WinUI and results in the full sized image next to the button in Android and the image skewed and distorted but with the correct height in iOS

I expect this to correctly render the image in the button to the left of the text in the button using the heightrequest to scale down to the requested height maintaining the images aspect ratio, see WinUI example above where the image and button are rendered correctly

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5

Did you find any workaround?

Reduce the image size manually to be the correct size desired on a device

Relevant log output

No response

@dotnet-policy-service dotnet-policy-service bot added the s/triaged Issue has been reviewed label May 9, 2024
@PureWeen PureWeen added legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-button Button, ImageButton and removed s/triaged Issue has been reviewed labels May 9, 2024
Copy link
Contributor

github-actions bot commented May 9, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@tj-devel709
Copy link
Member

Leaving a note here that the change was implemented but crashed upon device rotation

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@tj-devel709 tj-devel709 moved this from Todo to In Progress in MAUI SDK Ongoing May 21, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR6, .NET 8 SR7 Jun 3, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR7, .NET 8 SR8 Jul 5, 2024
@samhouts samhouts added the t/bug Something isn't working label Jul 31, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR8, .NET 8 SR9 Aug 2, 2024
@github-project-automation github-project-automation bot moved this from Ready To Review to Done in MAUI SDK Ongoing Aug 27, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants