don*_*don 2 c# binding xamarin font-awesome xamarin.forms
我正在尝试使用 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="" 它可以工作,但是当我尝试绑定它时它不起作用。
正如您在Binding font awesome character in XAML to Text 中所见,您可以使用 unicode 格式实现它。
您可以使用浏览器获取 unicode 值:
你只需要在斜杠('/')后添加一个u
| 归档时间: |
|
| 查看次数: |
2253 次 |
| 最近记录: |