UIImageView上的“涟漪效应”

时间:2012-08-30 07:13:10

标签: iphone objective-c ios xcode animation

我现在正在尝试使用代码制作Ripple动画下面的代码我每次都在同一位置制作动画

CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:2.0f];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:@"rippleEffect" ];
[imgView.layer addAnimation:animation forKey:NULL];

但我希望在imageview上的触摸点上获得动画 平均动画将发生在用户点击UIImageView

的那一刻

1 个答案:

答案 0 :(得分:3)

我认为以下代码可以帮助您。

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:(UIViewAnimationTransition) 110 forView:view cache:NO];
[UIView commitAnimations];

您还可以更好地访问与您的帖子类似的this帖子。