开发者

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

开发者 https://www.devze.com 2023-03-09 21:34 出处:网络
text block how to do: text trimming for a given height vertical alignment Can we use mytextBlock.TextTriming to trim the text?

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

精彩评论

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