问题
I have the following problem with my smileys:
<!-- Displays a colorful smiley -->
<PivotItem Header="Add 😶" FontFamily="Segoe UI Symbol">
<!-- Displays a black & white smiley -->
<TextBlock Text="😶" FontFamily="Segoe UI Symbol"/>
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: the top (yellow and white) smiley is the one of the pivot item, the red and transparent one are the textblocks. It's basically the background that I want to have in color, not the foreground:
Edit2: I just tried to use a TextBox instead of a TextBlock and the icon appears in color... it slowly starts to hint toward a TextBlock problem...
_Edit3: It still doesn't work, but at least I have found a way to go around the problem. See here for the solution.
回答1:
Use Foreground property to define color of the text. Like in the example:
<TextBlock Text="😶" Foreground="Navy" FontFamily="Segoe UI Symbol"/>
来源:https://stackoverflow.com/questions/32703574/segoe-ui-symbol-smiley-is-sometimes-colorful-sometimes-not