问题描述
我正在尝试在Xamarin应用程序中使用FontFamily。我下载了字体并将其添加到项目中,但仍未对文本应用更改。
Mobile.App :字体(文件夹)
catamaran-regular.tff
Mobile.App : AssemblyInfo.cs
using Xamarin.Forms;
[assembly: ExportFont("catamaran-regular.ttf")]
Mobile.App : App.xml
<Style
targettype="Label"
ApplyToDerivedTypes="true">
<Setter Property="FontFamily" Value="catamaran-regular" />
</Style>
Mobile.App.Views : Page.xml
Label
Text="Hello World!"
FontSize="18"
FontFamily="catamaran-regular">
</Label>