matthewrdev / fa2cs

Easily use FontAwesome icon codes in C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using it in Xaml

Joebu opened this issue · comments

commented

I tried using it in XAML as your demo but it doesn't work (setting the text in code behind does work)

<Label Text="{x:Static fontAwesome:FontAwesomeIcons.AmazonPay}"/>

Hi @Joebu,

Are you applying the correct FontAwesome font file to the label?

For fa-amazon-pay, you will need to apply the FontAwesome 5 Brands font family.

See: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/fonts#setting-the-font-in-xaml

Also, can you elaborate on "doesn't work"?

Does the code compile? Does the app crash at runtime? Does the icon simply not render?

commented

Sorry I didn't set the right font