Forum Xamarin.Forms

Material Design or Bootstrap Icon inside Toolbar Item

serasmserasm PLMember ✭✭

Hi,

I need help with icon inside toolbar item. I'm using FontImageSource inside IconImageSource.
The problem is that I don't know how to use Material Design or Bootstrap icons inside toolbar icon.
Can I do that? Use font image as Toolbar Icon?
How can I do that?

I downloaded ttf files and puted files inside Assets directory of Android. One of the file name is materialdesignicons-webfont.ttf.
Also I added code to app xaml file:
<OnPlatform x:Key="MaterialFont" x:TypeArguments="x:String"> <On Platform="Android" Value="materialdesignicons-webfont.ttf#Material Design Icons"/> </OnPlatform>

Can you help me?

Answers

  • JoeMankeJoeManke USMember ✭✭✭✭✭
    edited November 2019

    So what's the question? Do you just not know how create a FontImageSource in XAML? I feel like there has to have been a guide that told you how to define the static resource for that string that you didn't finish reading.

  • serasmserasm PLMember ✭✭

    Yeah, I was using name defined in App class. After adding static class with string values of icons everything is working.

Sign In or Register to comment.