dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.97k stars 1.71k forks source link

[iOS] Image on Button doesn't properly centered when setting ContentLayout to Top and text has 2 or more lines. #23635

Closed mecvillarina closed 1 week ago

mecvillarina commented 1 month ago

Description

Image on Button doesn't properly centered when setting ContentLayout to Top and text has 2 or more lines. Please attached image

Screenshot 2024-07-16 at 11 02 51 PM

Steps to Reproduce

  1. Create a new MAUI App
  2. Add the following lines on the MainPage.cs <Button ImageSource="ic_heart" LineBreakMode="WordWrap" Text="Add Waypoint" ContentLayout="Top,2" HorizontalOptions="Center" HeightRequest="150" WidthRequest="100" BackgroundColor="Blue" TextColor="White"/>
  3. Use the attached asset for your testing ic_heart
  4. Run the App.

Link to public reproduction project repository

https://github.com/mecvillarina/PocMaui

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month ago

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.

RoiChen001 commented 1 month ago

I can repro this issue at iOS platform on the latest 17.16.12 (build 410) (8.0.40&8.0.60).

tj-devel709 commented 1 month ago
image

Hello, looks like this will be fixed in this PR: https://github.com/dotnet/maui/pull/22476!