1

この投稿によると: https://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/

カスタム フォントを追加する新しい方法は、フォントを embeddedResource として追加し、App.xaml.ca に次の行を追加することです。

[assembly: ExportFont("DSEG7ModernRegular.ttf")]

しかし、私はこのエラーが発生します:

Error   CS0246  The type or namespace name 'ExportFontAttribute' could not be found (are you missing a using directive or an assembly reference?)

私のプロジェクトの参照:

  • Xamarin.Essentials (1.3.1)
  • Xamarin.Forms (4.4.0.991265) - 4.5
  • NetStandard.Library (2.0.3)
4

1 に答える 1