私はAndroidおよびUWPで問題なく、ContentPageでFontAwesomeを使用しています。 (Androidはラベルレンダリングクラスを使用します)。 しかし、NavigationPageをContnetPageに置き換えると、UWPのフォントアイコンが消え、私に正方形が表示されます! AndroidはNavigationPageで問題なく動作しています。 UWPはAndroidのようにレンダリングする必要がありますか?NavigationPages UWP Xamarin.FormsでFontAwesomeアイコンを使用するにはどうすればいいですか?
public class FontAwesomeIcon : Label
{
public const string Typeface = "FontAwesome";
public FontAwesomeIcon(string fontAwesomeIcon = null)
{
switch (Device.RuntimePlatform)
{
case Device.Windows :
{
FontFamily= "Assets/Fonts/FontAwesome.ttf#FontAwesome";
break;
}
case Device.Android :
{
FontFamily = Typeface;
break;
}
case Device.iOS:
{
FontFamily = Typeface;
break;
}
}
Text = fontAwesomeIcon;
VerticalOptions = LayoutOptions.Center;
}
/// <summary>
/// Get more icons from http://fortawesome.github.io/Font-Awesome/cheatsheet/
/// Tip: Just copy and past the icon picture here to get the icon
/// </summary>
public static class Icon
{
public static string AngleRight = "\uf105";
public static string User = "\uf007";
public static string Lock = "\uf023";
}
}
アップデート:私はContnetPageでNavigationPageを交換する際に
答えは、我々はしかし、この[email protected]"/Assets/Fonts/FontAwesome.ttf#FontAwesome"
どちらもNavigationPageで動作しません。 私のフォントファイルが「資産/フォント」フォルダの「FontAwesome.ttf」であるため、「FontAwesome.ttf」を使用しています... –
私の答えが見つかりました。とにかくありがとうございました。 –
私に解決策を教えてください。この問題に遭遇した他のユーザーが参照できるようにします。 –