ios CATransform3DMakeScale扩展动画

时间:2012-08-27 06:28:27

标签: ios xcode animation subview scaletransform

我有以下动画:

CATransform3D scaleTransform = CATransform3DMakeScale(0.1,0.1, 1.0);
scaleAnimation.toValue = [NSValue valueWithCATransform3D:scaleTransform];
keyframeAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];;

我正在缩小子视图。但我正试图做相反的事情。从子视图大小的0.01%开始,并转到子视图大小的100%。有谁知道我该怎么做?

1 个答案:

答案 0 :(得分:6)

这样做:

yourSubView.transform = CGAffineTransformMakeScale(0.01, 0.01);
[UIView animateWithDuration:0.4 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 
//change time duration according to requirement
// animate it to the identity transform (100% scale)
yourSubView.transform = CGAffineTransformIdentity;
} completion:^(BOOL finished){
// if you want to do something once the animation finishes, put it here
}];