小编don*_*don的帖子

母版页 Xamarin 表单上的绑定字体图标

我正在尝试使用 Font Awesome 在我的母版页中添加字体。这是我的代码

new NavMenuItem { Id = 3, Title = "Home", TargetType = typeof(NavDetail), icon = ""}
Run Code Online (Sandbox Code Playgroud)

这是我的母版页标签代码enter code here

<Label VerticalOptions="FillAndExpand"          
    VerticalTextAlignment="Center"
    Text="{Binding icon}"                                   
    Style="{DynamicResource FontLabel}"
    FontSize="24" />
Run Code Online (Sandbox Code Playgroud)

问题是它只是按原样打印出十六进制值,而不是打印图标。如果我简单地写 Text="" 它可以工作,但是当我尝试绑定它时它不起作用。

c# binding xamarin font-awesome xamarin.forms

2
推荐指数
2
解决办法
2253
查看次数

标签 统计

binding ×1

c# ×1

font-awesome ×1

xamarin ×1

xamarin.forms ×1