如何找出fontAwesome中用于字符的XAML代码?

问题描述 投票:1回答:1

在unicode中,我有一个由"\uf2fc"指定的角色。有人可以告诉我如何将FO文档中的unicode表单转换为我可以在XAML中使用的那些吗? XAML值曾经在网页上列出,但不再列出它们,只是给出了Unicode。

https://fontawesome.com/icons/rectangle-wide?style=regular

请注意,新版本的备忘单不包括旧版本的XAML代码。

https://fontawesome.com/cheatsheet/pro

android ios xamarin xamarin.forms font-awesome
1个回答
1
投票

另一种方法是实现一个“FontAwesome.cs”类,然后用静态变量填充它:

public class FontAwesome
{
    public static string FAGlass = "\uf000";
    public static string FAMusic = "\uf001";
    public static string FASearch = "\uf002";
    public static string FAEnvelopeO = "\uf003";
    public static string FAHeart = "\uf004";
    public static string FAStar = "\uf005";
    public static string FAStarO = "\uf006";
    public static string FAUser = "\uf007";
    public static string FAFilm = "\uf008";
    public static string FAThLarge = "\uf009";
    public static string FATh = "\uf00a";
    public static string FAThList = "\uf00b";
    public static string FACheck = "\uf00c";
    public static string FATimes = "\uf00d";
    public static string FASearchPlus = "\uf00e";
    ...
}

然后,只要需要,您就可以在xaml中访问它:

<Label Text="{x:Static fontAwesome:FontAwesome.FABriefcase}" />

请注意,这要求您在Xaml中包含该类:

xmlns:fontAwesome="clr-namespace:MyApp.Globals;assembly=MyApp"
© www.soinside.com 2019 - 2024. All rights reserved.