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.85k stars 1.68k forks source link

FontImageSource in Button and ImageButton doesn't display properly #23191

Open Vroomer opened 3 weeks ago

Vroomer commented 3 weeks ago

Description

Following example uses black ImageButton and Button to show white square as an icon. I would expect all buttons to look the same regardless of whether they use ImageSource or FontImageSource. However the FontImageSource lacks resolution and has wrong position on both Android and Windows. Adding Size to the FontImageSource helps with the resolution, but doesn't fix the position. Aspect options on ImageButton don't have any effect. ImageButton also loses its shape in combination with FontImageSource on Android. I didn't test iOS/macOS.

Android: image

Windows: image

Steps to Reproduce

  1. Load the repository and run the app.
  2. Observe the inconsistency between Button and ImageButton with ImageSource and FontImageSource.

Link to public reproduction project repository

https://github.com/Vroomer/MAUI-FontImageSource-in-Button-and-ImageButton-bug.git

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

Android, Windows, I was not able test on other platforms

Affected platform versions

Windows SDK 10.0.19041.0

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 3 weeks 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!

Closed similar issues:

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

kevinxufei commented 3 weeks ago

Verified this issue with Visual Studio 17.11.0 Preview 2.1 (8.0.60 & 8.0.40 & 8.0.10). Can repro this issue with sample project on android & Windows platforms.