开发者

text block how to do 1. text trimming 2. vertical alignment for windows phone

text block how to do:

  1. text trimming for a given height
  2. vertical alignment

Can we use mytextBlock.TextTriming to trim the text? I have tried to trim text with specifying height but its not working same with the vertical alignment.

I tried TextAlignment = center but its alignin开发者_如何学JAVAg text horizontally.


Text trimming is not supported in the current version of the framework. However, Robby Ingebretsen's TextTrimming TextBlock for Silverlight works if you recompile it for WP7.


To align the TextBlock vertically you can do this:

<TextBlock VerticalAlignment="Center" ... />

and ensure that you have the same (or no) margin top and bottom.


You have to add 2 attributes for text trimming for a particular height TextWrapping="Wrap" TextTrimming="Ellipsis"

Along with this you need width or maxwidth value for text wrap to work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜