Search code examples
xamlxamarin.formsembedded-fontsxamarin.forms.shell

How to change font family for Xamarin Shell FlyoutItem


Is there any way to change the font family of contents inside FlyoutItem in Xamarin Forms Shell?

I've already added custom .ttf fonts in shared project as embedded resource and also registered the font file with the assembly using the file, AssemblyInfo.cs.

Any help would be appreciated.


Solution

  • For Shell Flyout content (Flyout Items + menu items) you can use a style with FlyoutItemLabelStyle class:

    <Style ApplyToDerivedTypes="True" Class="FlyoutItemLabelStyle" TargetType="Label">
         <Setter Property="FontFamily" Value="YourFontExportName"/>
    </Style>
    

    From docs Style FlyoutItem and MenuItem objects.

    Related questions

    How to use Font Awesome icons in project as an icon of ImageButton

    Using Material Design Icons with Xamarin Forms - What Am I Missing?