-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[iOS] Use updated APIs for the button with images #20953
Conversation
Bringing over this comment: 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: This is the relevant xaml: <ScrollView HeightRequest="100" WidthRequest="50">
<ImageButton Source="dotnet_bot.png" />
</ScrollView> |
Could we move |
395da71
to
c051eb7
Compare
e5aec15
to
b4d09d9
Compare
becfb16
to
e01061e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -4,7 +4,7 @@ | |||
namespace Maui.Controls.Sample.Issues | |||
{ | |||
[XamlCompilation(XamlCompilationOptions.Compile)] | |||
[Issue(IssueTracker.Github, 18242, "Button ImageSource not Scaling as expected", PlatformAffected.UWP)] | |||
[Issue(IssueTracker.Github, 18242, "Button ImageSource not Scaling as expected", PlatformAffected.All)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we include here a sample using a different ContentLayout (for example, Top)?
Could we include a case using dynamic size?. We can include a button, and tapping it just increase at runtime the height using a random value.
Since this PR is not addressing resizing, removed the existing UITest for iOS that was testing resizing and instead added a UITest with a screenshot test to make sure the different image placements work with the button. Will wait for the UITest to produce the diffs! |
|
||
App.WaitForElement("WaitForStubControl"); | ||
|
||
VerifyScreenshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The windows screenshot is looking a little funky. Testing on windows |
Possibly related |
* Ensure images in buttons never scale up, only down * Use `GetImageSourceSize` * Port UI tests from #20953 * Ensure max height is reset Ensure source is set after image opened event is subscribed to --------- Co-authored-by: Mike Corsaro <[email protected]>
Closing for now until coming back to this one! |
Description of Change
Cherry pick iOS only changes from #19834This PR updates a deprecated API in iOS to use the newer UIButton.Configuration API. Resizing is not really an option anymore with the new API and requires creating a new image each time. For now, let's update to the new API.
Issues Fixed
Makes progress towards #9734
Makes progress towards #21394