How to increase height limit of the TextBlock control in Windows Phone

♀尐吖头ヾ 提交于 2019-12-01 11:30:56

问题


I need to create a view with multiple TextBlocks populating thousands words. Unfortunately, when I set the Text of the TextBlock to contain a string longer than approx. 2000 characters the later part of the string is not displayed. The size of the TextBlock is still as if it contained all the characters, but the bottom of it is just blank.

Do you know what is the constraint that limit the length of the TextBlock? And how can I override it?


回答1:


This is a limitation of the TextBox implementation on Windows Phone. If the area is larger thatn 2048 x 2048 it gets clipped.

This blog post has a workaround.




回答2:


No UIElement can be greater than 2048 pixels in either dimension, however, if you exceed this limit, the space for the larger element is still reserved.

As a workaround, see this blog post which has a simple technique for splitting text into multiple TextBlocks.



来源:https://stackoverflow.com/questions/10696050/how-to-increase-height-limit-of-the-textblock-control-in-windows-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!