可能重复:
How do you create a wiggle animation similar to iphone deletion animation
其实这是一个答案!我为想要使用UIImageView
Wiggle效果代码:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.14];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationRepeatCount:10000];
myImage.transform = CGAffineTransformMakeRotation(69);
myImage.transform = CGAffineTransformMakeRotation(-69);
[UIView commitAnimations];
停止动画,你可以使用这段代码:
myImage.transform = CGAffineTransformMakeRotation(0);
[myImage.layer removeAllAnimations];
//#import <QuartzCore/QuartzCore.h> to remove a compiler warning ;)
希望你喜欢它。