我正在尝试使用 app.xaml 中的样式为整个 xamarin 表单应用程序设置自定义字体。但我得到了同样的未处理异常。
<OnPlatform x:Key="AppFontFamily" x:TypeArguments="x:String"
Android="customfont.otf#CustomFont-Regular">
</OnPlatform>
<Style x:Key="labelFont" TargetType="Label">
<SetterProperty Property="FontFamily" Value="{StaticResource AppFontFamily}"></SetterProperty>
</Style>
在我的内容页面中使用样式如下
<Label Style="{StaticResource labelFont}"></Label>
有什么解决办法吗?