2011-12-18 46 views
2

如何使用任何视图(比如说UIButton)使用Quartz中的转换来颠倒视图?我试过button1.transform = CGAffineTransformMakeRotation(M_PI);与许多其他值(M_PI除外),但没有正常工作。任何视图的颠倒转换

+0

你试过这个后发生了什么? – PengOne

+0

它水平变换并翻转,我希望它恢复到原来的状态(翻转到正常),也许我拼错了这个问题:我希望这个标签能够回到原来的状态。 – JAHelia

+0

'CGAffineTransformMakeRotation(M_PI);'旋转图像。您想要反转并旋转图像。 – PengOne

回答

5

CGAffineTransformMakeRotation(M_PI);旋转固定左上角的图像。如果您希望锚定中心,则需要在变换之前或之后移动UIButton

您的评论阅读就像你想反转和旋转图像。

+0

如何在旋转后重新定位UIButton? – JAHelia

+0

'button.center = ...' – PengOne

+0

感谢兄弟,作为一名数学家,请你参考这个问题:http://stackoverflow.com/questions/8545185/transforming-uitableview-to-support-right-to-left -languages – JAHelia