I'm using a custom image (which is 360 x 276 so not proportional) and I'm rotating it with an animation. The anchor point is not just (0,.5) or (1,0), it's something like (.23423, .912314). Is there any way to show, where the anchor point currently is? Or setting it in InterfaceBuilder? Currently I'm just trying to reach the correct CGPoint by testing different values, but I didn't get the perfect one.
问问题
68 次
2 回答
0
不幸的是,你不能简单地在 IB 中设置它。在您的情况下,我会使用一些图像处理应用程序来找出您需要图像旋转的坐标,然后进行数学运算:
84,3228 / 360 = 0.24423
不一定很出色,但我会说是可行的。
于 2013-03-07T12:18:41.000 回答
0
这可能会有所帮助。
CGPoint anchorPosition = CGPointMake(
imageView.frame.origin.x + imageView.frame.size.width*anchorPoint.x,
imageView.frame.origin.y + imageView.frame.size.height*anchorPoint.y);
可以参考http://disanji.net/iOS_Doc/#documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/Layers.html
于 2013-03-07T12:06:36.613 回答