爲了使圖像看起來由左到右,我設置了anchorPoint像這樣:設置一個UIImageView anchorPoint沒有在接口改變位置生成器
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中設置的位置,當設置了anchorPoint時,它會移動相當多的位置。
有沒有人知道是否有方法來設置anchorPoint或完成此效果而不更改在Interface Builder中圖像的位置?
謝謝!
確保你明白什麼是anchorPoint:http://stackoverflow.com/a/22188420/550393 – 2cupsOfTech