maui icon indicating copy to clipboard operation
maui copied to clipboard

[Android, iOS, Windows] Correctly scale Button image

Open jsuarezruiz opened this issue 1 year ago • 3 comments

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

jsuarezruiz avatar Jan 11 '24 14:01 jsuarezruiz

It's looking pretty good to me on iOS and android! image

tj-devel709 avatar Feb 15 '24 16:02 tj-devel709

/rebase

mattleibow avatar Feb 16 '24 14:02 mattleibow

/rebase

mattleibow avatar Feb 16 '24 15:02 mattleibow

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: image

Android: image

Windows: image

This is the relevant xaml:

<ScrollView HeightRequest="100" WidthRequest="50">
   <ImageButton Source="dotnet_bot.png" />
</ScrollView>

tj-devel709 avatar Mar 01 '24 20:03 tj-devel709

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/

jsuarezruiz avatar Mar 04 '24 12:03 jsuarezruiz

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.

mattleibow avatar Mar 05 '24 18:03 mattleibow

/rebase

PureWeen avatar Mar 05 '24 20:03 PureWeen

I can't seem to repro that and I only do special things for bottom: image

mattleibow avatar Mar 07 '24 20:03 mattleibow

@PureWeen is there a way to know on which version this fix is gonna be released?

romerotg avatar Mar 18 '24 15:03 romerotg