【问题标题】:Default colors is not showing in fonts Xamarin.Forms默认颜色未在字体 Xamarin.Forms 中显示
【发布时间】:2020-04-28 11:08:23
【问题描述】:

默认表情符号在我的 Xamarin.Forms 应用程序中运行良好,而且色彩丰富。当我添加Twitter color fonts 时,它变为黑白(黑白)。这个Procedure我关注了。

初始化

[assembly: ExportFont( "TwitterColorEmoji.ttf", Alias = "TwitterColorEmoji" )]

这是xaml中的示例代码

<!-- This is not working -->
<Label x:Name="emojilbl" Text="\U+1F1E9" Margin="20,0,0,0"></Label>
<Label 
    x:Name="emoji2lbl" 
    Text="&#x1F1E6;&#x1F1E8;" 
    Margin="20,0,0,0" 
    TextColor="#5EE514" 
    FontSize="40" 
    FontFamily="TwitterColorEmoji"></Label>

<!-- This is not working -->
<Image BackgroundColor="Black">
    <Image.Source>
        <FontImageSource 
            FontFamily="TwitterColorEmoji"
            Glyph="&#x1F1E6;&#x1F1E8;" 
            Size="40" 
            > 
        </FontImageSource>
    </Image.Source>
</Image> 

<!-- This is working fine with default font -->
<Label Text="&#x1F1E6;&#x1F1E8;"  Margin="20,0,0,0" FontSize="40"/>

为什么表情符号不显示自己的颜色。 感谢您的帮助。

【问题讨论】:

    标签: xaml xamarin xamarin.forms fonts emoji


    【解决方案1】:

    通过将“嵌入式资源”更改为“资源”选项解决了问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-13
      • 1970-01-01
      • 1970-01-01
      • 2014-11-03
      • 1970-01-01
      • 2020-06-02
      • 1970-01-01
      相关资源
      最近更新 更多