当事件发生时,我使用下面的代码来缩放视图。但是我想用动画来放大或缩小视图,而不是直接看到缩放结果。我怎样才能达到这个效果呢?
view.transform = CGAffineTransformMakeScale(scaleFactor, scaleFactor) 发布于 2012-06-06 20:17:30
您可以使用UIViewAnimations
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelay:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
view.transform = CGAffineTransformMakeScale(scaleFactor, scaleFactor);
[UIView commitAnimations];发布于 2012-06-06 20:30:27
也可以使用块动画。
[UIView animateWithDuration:0.3 animations:^{
view.transform = CGAffineTransformMakeScale(scaleFactor, scaleFactor)
}];https://stackoverflow.com/questions/10914000
复制相似问题