问题描述
我的笑脸有以下问题:
<!-- Displays a colorful smiley -->
<PivotItem Header="Add 😶" FontFamily="Segoe UI Symbol">
<!-- Displays a black & white smiley -->
<TextBlock Text="😶" FontFamily="Segoe UI Symbol"/>
如何在TextBlock中获得漂亮的彩色笑脸?它是TextBlock的特殊性吗?我应该使用其他组件来显示此文本吗?如果是,那是哪个?谢谢!
How do I get a nice colorful smiley in a TextBlock? Is it a particularity of the TextBlock? Should I use another component to display this text... and if so, which one? Thanks!
Edit1:顶部(黄色和白色)笑脸是关键项之一,红色和透明的笑脸是文本块.基本上是我要具有颜色的背景,而不是前景:
Edit2:我只是尝试使用TextBox而不是TextBlock,并且图标显示为彩色...它慢慢开始提示出现TextBlock问题...
_Edit3:它仍然不起作用,但是至少我找到了解决该问题的方法.有关解决方案,请参见此处.
_ It still doesn't work, but at least I have found a way to go around the problem. See here for the solution.
推荐答案
使用Foreground属性定义文本的颜色.像示例中一样:
Use Foreground property to define color of the text. Like in the example:
<TextBlock Text="😶" Foreground="Navy" FontFamily="Segoe UI Symbol"/>