字体Xamarin.Forms中未显示默认颜色

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

默认表情符号在我的Xamarin.Forms应用程序中可以正常工作,并且色彩丰富。当我添加Twitter color fonts时,其变为B / W(黑白)。我遵循了此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"/>

enter image description here

为什么表情符号没有显示自己的颜色。感谢您提供高级帮助。

xaml xamarin xamarin.forms fonts emoji
1个回答
0
投票

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

enter image description hereenter image description here

© www.soinside.com 2019 - 2024. All rights reserved.