Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Xamarin表单中使用字体Awesome进行代码隐藏?_Xamarin_Xamarin.forms_Fonts_Font Awesome - Fatal编程技术网

如何在Xamarin表单中使用字体Awesome进行代码隐藏?

如何在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"

我很难创建一个字体很棒的文本表单。在.xaml文件中执行此操作时,一切正常,如下所示:

<?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="&#xf00c;"
          FontFamily="Font Awesome 5 Free-Solid-900.otf#Regular"
          FontSize="40" />
</ContentPage>
Text = "\uf00c",


其中每一项的结果都是:

我做错了什么?

尝试使用\u而不是&#x

所以它应该是这样的:

<?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="&#xf00c;"
          FontFamily="Font Awesome 5 Free-Solid-900.otf#Regular"
          FontSize="40" />
</ContentPage>
Text = "\uf00c",
Text = "\uf00c",