maui icon indicating copy to clipboard operation
maui copied to clipboard

[iOS] TabBar Icons not showing when using FontIconSource for Tab.Icon

Open ewerspej opened this issue 1 year ago • 19 comments

Description

The icons of the tabs are not showing up on iOS when using FontIconSource on the Tab.Icon property.

Steps to Reproduce

  1. Create a MAUI App using Shell
  2. Add the materialdesignicons-webfont.ttf or any other icon font
  3. Register the icon font in MauiProgram.cs using AddFont() in the builder
  4. Define the Icons as static resources in App.xaml or any other resource dictionary
  5. In AppShell.xaml, add a TabBar with Tabs
  6. Use the FontIconSource type on the Tab.Icon property and choose the desired static resource as a glyph
  7. Debug on iOS

Expected Behavior: The TabBar displays the Icons from the FontIconSource Actual Behavior: The TabBar does not display the Icons FontIconSource

Hint: This works fine on Android

Example code:

Resource Dictionary:

  <x:String x:Key="SettingsIcon">&#xF0493;</x:String>
  <x:String x:Key="TimerIcon">&#xF0954;</x:String>

Shell:

  <TabBar>
    <Tab
      Title="{x:Static strings:Strings.HomeLabel}">
      <Tab.Icon>
        <FontImageSource
          FontFamily="materialdesignicons"
          Glyph="{StaticResource TimerIcon}"/>
      </Tab.Icon>
      <ShellContent
        ContentTemplate="{DataTemplate views:MainPage}"
        Route="MainPage"/>
    </Tab>
    <Tab
      Title="{x:Static strings:Strings.SettingsLabel}">
      <Tab.Icon>
        <FontImageSource
          FontFamily="materialdesignicons"
          Glyph="{StaticResource SettingsIcon}"/>
      </Tab.Icon>
      <ShellContent
        Title="{x:Static strings:Strings.SettingsLabel}"
        ContentTemplate="{DataTemplate views:SettingsPage}"
        Route="SettingsPage"/>
    </Tab>
  </TabBar>

Link to public reproduction project repository

https://github.com/ewerspej/dotnet-maui-bug-repro-ios-tabs-shell/

Version with bug

7.0.100-rc.1.22431.12

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5

Did you find any workaround?

No

Relevant log output

No response

ewerspej avatar Sep 27 '22 16:09 ewerspej