【问题标题】:Font awesome icon not showing up in Xamarin.Forms字体真棒图标未显示在 Xamarin.Forms
【发布时间】:2019-04-03 10:22:42
【问题描述】:

字体真棒图标在 Xamarin.Forms 中不适合我。这是我的Labelxaml

<Label TextColor="Red" FontFamily="FontAwesomeBrands"  FontSize="Large" Text="&#xf122;"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Width,Factor=1}">
</Label>

我已将这些文件添加到 android 项目的 Assests 文件夹中

输出只显示空符号。我怎样才能让它工作?

【问题讨论】:

标签: xaml xamarin xamarin.forms font-awesome


【解决方案1】:

您是否为此创建了特定于平台的CustomRenderers

请看我的回答,然后按照教程进行操作。 Link to answer

希望这会有所帮助!

【讨论】:

  • 谢谢。但这并不是我真正想要的。似乎 FA 图标也可以在没有自定义渲染器的情况下使用。
【解决方案2】:

我对图标使用 Xam.FormsPlugin.Iconize 和 Xam.Plugin.Iconize NuGet 包:

xmlns:iconize="clr-namespace:FormsPlugin.Iconize;assembly=FormsPlugin.Iconize" 

<iconize:IconLabel Text="fa-question-circle" FontSize="Medium" TextColor="#666666" HorizontalTextAlignment="End"/>

【讨论】:

  • 这是要求降级 xamarin 表单库 3.5 t 3.2。
猜你喜欢
  • 2017-09-06
  • 2018-12-07
  • 2017-11-06
  • 1970-01-01
  • 1970-01-01
  • 2015-10-21
  • 1970-01-01
  • 1970-01-01
  • 2018-02-16
相关资源
最近更新 更多