如何在Xamarin表单中使用字体Awesome进行代码隐藏?
我很难创建一个字体很棒的文本表单。在.xaml文件中执行此操作时,一切正常,如下所示:如何在Xamarin表单中使用字体Awesome进行代码隐藏?,xamarin,xamarin.forms,fonts,font-awesome,Xamarin,Xamarin.forms,Fonts,Font Awesome,我很难创建一个字体很棒的文本表单。在.xaml文件中执行此操作时,一切正常,如下所示: <?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Name="contentPage" xmlns="http://xamarin.com/schemas/2014/forms"
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Name="contentPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="myappname.Main">
<Label Text=""
FontFamily="Font Awesome 5 Free-Solid-900.otf#Regular"
FontSize="40" />
</ContentPage>
Text = "\uf00c",
其中每一项的结果都是: 我做错了什么?尝试使用\u而不是 所以它应该是这样的:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Name="contentPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="myappname.Main">
<Label Text=""
FontFamily="Font Awesome 5 Free-Solid-900.otf#Regular"
FontSize="40" />
</ContentPage>
Text = "\uf00c",
Text = "\uf00c",