【发布时间】:2011-10-16 21:35:17
【问题描述】:
当我将 UIImageView 显示为子视图时,如何添加反弹效果?我必须使用 CoreAnimation 来执行此操作吗?我现在唯一的猜测是使用 CAKeyframeAnimation,如果有更好的方法,请告诉我。这是我当前的代码:
CABasicAnimation * theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
theAnimation.delegate = self;
theAnimation.duration = 1.0;
theAnimation.fromValue = [NSNumber numberWithFloat:notif.center.y];
theAnimation.toValue = [NSNumber numberWithFloat:notif.center.y-20];
theAnimation.repeatCount = 3;
【问题讨论】:
-
嗨阿迪特。你能详细说明一下吗? “反弹效应”到底是什么意思?你有什么例子可以展示吗?
-
我的意思是,当它显示时,我希望它上下反弹几次。类似entheosweb.com/Flash/bouncing_effect.asp
标签: iphone objective-c ipad core-animation