Textblock占用相同的水平空间甚至应用RotateTransform

Nak*_*ary 2 wpf xaml

我在文本块上应用RotateTransform,使其垂直显示文本而不是水平显示文本,但在未进行转换时水平占用相同的空间.请建议解决方案,以删除这个hozitonally sapce.

<Border  BorderBrush="#888888" BorderThickness="0,0,2,0">
    <TextBlock FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" FontSize="15" Text="Menu" >
        <TextBlock.RenderTransform>
            <RotateTransform Angle="270" />
        </TextBlock.RenderTransform>
     </TextBlock>
</Border>
Run Code Online (Sandbox Code Playgroud)

Ern*_*rno 5

使用LayoutTranform而不是RenderTransform

<Border  BorderBrush="#888888" BorderThickness="0,0,2,0">
    <TextBlock FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" FontSize="15" Text="Menu" >
        <TextBlock.LayoutTransform>
            <RotateTransform Angle="270" />
        </TextBlock.LayoutTransform>
     </TextBlock>
</Border>
Run Code Online (Sandbox Code Playgroud)