Segoe UI符号表情符号字符在Windows Phone 8.1上不显示颜色

时间:2014-06-03 09:03:07

标签: c# windows-phone-8 colors character winrt-xaml

在Windows Phone 8上,以下xaml显示颜色的表情符号字符:

<TextBlock 
    FontFamily="Segoe UI Symbol"
    TextOptions.DisplayColorEmoji="True"
    Text="smilie's unicode that I don't have off-hand"/>

但是,当此代码在Windows Phone 8.1上运行时,表情符号的背景颜色未填充。也就是说,它没有黄色背景;表情符号的轮廓只有颜色。

因此,例如,它在Windows Phone 8.0中看起来像这样:

enter image description here

但它在Windows Phone 8.1中看起来像这样:

enter image description here

我已经看过Windows Phone 8.1。介绍一个新的&#34; IsColorFontEnabled&#34;属性。我不知道这是否在8.1上修复它,但我知道为了使用它,我必须将应用程序迁移到8.1,我不想这样做,因为我想保持8.0向后兼容性暂时的。

那么,有没有办法让Windows Phone 8.0 Silverlight应用程序使用彩色表情符号,它也可以在Windows Phone 8.1上以彩色显示?

1 个答案:

答案 0 :(得分:1)

在Windows Phone 8.1中,我们可以在TextBlock中使用 IsColorFontEnabled 来显示带颜色的表情符号。 IsColorFontEnabled 是布尔值的类型,默认值为false(表示不显示颜色)。但是,如果您设置FontFamily="Segoe UI Symbol",颜色表情符号,也不会显示

示例代码如下:

<TextBlock IsColorFontEnabled ="True" Text="I am a TextBlock "/>

如果您不想将项目重新定位到Windows Phone 8.1,只需删除 FontFamily =&#34; Segoe UI符号&#34; ,如下所示:

<TextBlock TextOptions.DisplayColorEmoji="True" Text="I am a TextBlock "/>

因为如果您将fontfamily设置为Segoe UI Symbol,表情符号将显示为字符