Sharpnado.Tabs icon indicating copy to clipboard operation
Sharpnado.Tabs copied to clipboard

MAUI - FontIcon for IconImageSource padding

Open m1dst opened this issue 1 year ago • 1 comments

Platform (please complete the following information):

  • OS: Android
  • Device: AndroidEmulator
  • Sdk version: API30
  • MAUI: [8.0.3]

Describe the bug I tried replacing a png with a fonticon and the scaling and padding was ignored.

<tabs:TabButton
    x:Name="TabButton"
    ButtonBackgroundColor="{StaticResource Primary}"
    ButtonCircleSize="60"
    ButtonPadding="20"
    IconImageSource="camera_96.png"
     />

produces image

  <tabs:TabButton
      x:Name="TabButton"
      ButtonBackgroundColor="{StaticResource Primary}"
      ButtonCircleSize="60"
      ButtonPadding="20"
      IconImageSource="{FontImage {StaticResource fa-camera},
        FontFamily=FontAwesomeSolid,
        Color='White',
        Size=96 }"
       />

produces image

If I edit the ButtonPadding to zero and then back to 20 using the live editor then it works as expected.

image

m1dst avatar Feb 12 '24 13:02 m1dst

Perhaps it is related to this? https://github.com/dotnet/maui/issues/18857

m1dst avatar Feb 12 '24 13:02 m1dst

@m1dst Do you think it has something to do with the size you are setting to your icon in IconImageSource?

FreakyAli avatar May 31 '24 08:05 FreakyAli

I've since found this is a Maui bug. It has been fixed in the next release of Maui but isn't available today.

m1dst avatar May 31 '24 08:05 m1dst