【发布时间】:2012-10-06 03:52:23
【问题描述】:
为了使图像从左到右显示,我将锚点设置为:
myImageView.layer.anchorPoint = CGPointMake(0.0f, 1.0f);
然后对其进行动画处理:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
myImageView.transform = CGAffineTransformMakeScale(1.0, 1.0);
[UIView commitAnimations];
动画效果很好,但是通过更改图像的锚点,图像不会出现在界面生成器中设置的位置,当设置锚点时,它会移动很多。
有人知道是否有一种方法可以设置anchorPoint 或在不更改图像在Interface Builder 中的位置的情况下实现此效果吗?
谢谢!
【问题讨论】:
-
确保你了解什么是锚点:stackoverflow.com/a/22188420/550393
标签: iphone interface-builder layer