Search code examples
xamarinxamarin.formsfontsxamarin.androidglyph

Xamarin FontImageSource Glyph not showing up


I am trying to add a font icon using the following code:

    <Image>
        <Image.Source>
            <FontImageSource
                FontFamily="{OnPlatform iOS=Ionicons,
                                        Android=ionicons.ttf#}"
                Glyph="&#xf37f;"
                Size="44"
                Color="Red" />
        </Image.Source>
    </Image>

which I found on the official Microsoft Docs. However, the icon doesn't show up on my Android phone, instead I get this (symbol not found placeholder): Unknown symbol placeholder


Solution

    1. You miss a "#" after Android=ionicons.ttf :

      <Image>
          <Image.Source>
              <FontImageSource
                  FontFamily="{OnPlatform iOS=Ionicons,Android=ionicons.ttf#}"
                  Glyph="&#xf37f;"
                  Size="44"
                  Color="Red" />
          </Image.Source>
      </Image>
      
    2. I don't think there is a icon font named f37f in the ionicons