Man*_*asu 3 xaml textblock xaml-designer winrt-xaml
我有一个带有文本块和图像的stackpanel.我需要将文本块对齐到旋转中心(90度).就像这样,
但是,在旋转文本块后,我总是得到这样的结果,
这是我正在使用的XAML代码,
<StackPanel Orientation="Horizontal">
<Image Width="120" Source="ms-appx:///Assets/mail.jpg"/>
<TextBlock Text="send mail" FontSize="15" Margin="25,0,0,0" >
<TextBlock.RenderTransform>
<RotateTransform Angle="90"/>
</TextBlock.RenderTransform>
</TextBlock>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
我如何将我的文本块对齐到中心..?
将TextBlock的VerticalAlignment设置为"Center"并通过设置RenderTransformOrigin在TextBlocks中心点周围旋转应该会有所帮助.
<TextBlock Text="xyz" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Margin="25,0,0,0">
<TextBlock.RenderTransform>
<RotateTransform Angle="90" />
</TextBlock.RenderTransform>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)