如何在故事板中设置包含换行符的文本 [英] How to set text including new line character in storyboard
本文介绍了如何在故事板中设置包含换行符的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
想用换行符替换\n"
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Text" Storyboard.TargetName="textBlock">
<DiscreteObjectKeyFrame KeyTime="0" Value="Here is my text.\nThis is new line"/>
</Storyboard>
</VisualState>
输出文本是:这是我的文本.\n这是新行
没有换行符.
The output text is: Here is my text.\nThis is new line
without new line character.
P.S.:如果这个值可以用资源文件中的字符串填充,那就太好了..!!无论哪种方式都会帮助我,但稍后一个是好方法.
P.S.: If this value can be filled with the string in resource file that would be a great..!! Either way will help me out but later one is good approach.
推荐答案
当然...
Value="Here is my text. This is new line"
希望这会有所帮助.
这篇关于如何在故事板中设置包含换行符的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文