如何使wpf Textblock
控制堆栈从底部到顶部进行文本,而不是使用固定高度时,而不是从上到下?这是我的意思的示例:
Textblock
带一条线
*********** My Text ***
*********** instead of ***********
My Text *** ***********
Textblock
有两行
*********** My Text is
My Text is instead of bigger ****
bigger **** ***********
有什么方法可以实现这一目标?
简单地将VerticalAlignment
属性设置为Bottom
怎么样?如果您有围绕实际文本的东西,例如,可以将TextBlock
放在Grid
或Border
中,并设置此高度:
<Border Background="Yellow" Height="300">
<TextBlock VerticalAlignment="Bottom">one line at the bottom</TextBlock>
</Border>