maui
maui copied to clipboard
[Android, iOS, Windows] Correctly scale Button image
Description of Change
Correctly scale the Button image on Android and Windows.
NOTE: We require the server's snapshots for the golden test. The PR is a Draft until the snapshots are generated.
Issues Fixed
Fixes #9734 Fixes #18242
It's looking pretty good to me on iOS and android!
/rebase
/rebase
It appears that there is an issue on iOS with an ImageButton inside a scrollview. The image does not resize with the width request as android and Windows does. Check out the bottom imagebutton in each of the screenshots:
iOS:
Android:
Windows:
This is the relevant xaml:
<ScrollView HeightRequest="100" WidthRequest="50">
<ImageButton Source="dotnet_bot.png" />
</ScrollView>
We already have the changes to fix Windows merged on main branch and the iOS fix will be https://github.com/dotnet/maui/pull/20953/
I tried a different approach where just before measuring the button, I calculate the best image size if it were to fill in the space and then let Android do the rest with the adjusted image.
/rebase
I can't seem to repro that and I only do special things for bottom:
@PureWeen is there a way to know on which version this fix is gonna be released?