如何做到围绕XAML控制的旋转中心 [英] How to do rotation around control's center in XAML

查看:228
本文介绍了如何做到围绕XAML控制的旋转中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

欲做旋转按钮90度,但它被削波,因为它旋转arount(0,0)。如何使它绕中心,如果我不知道以像素为单位it't宽度(它是许多按钮模板)


解决方案

 <按钮...> 
< Button.LayoutTransform>
< RotateTransform的centerX =0.5CenterY =0.5角度=90/>
< /Button.LayoutTransform>
< /按钮>


I want do rotate button to 90 degrees but it gets clipped because it rotates arount (0,0). How to make it rotate around center if I don't know it't width in pixels (it's a template for many buttons)

解决方案

<Button ...>
  <Button.LayoutTransform>
    <RotateTransform CenterX="0.5" CenterY="0.5" Angle="90"/>
  </Button.LayoutTransform>
</Button>

这篇关于如何做到围绕XAML控制的旋转中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆