button 点击一下跳动的效果

button.transform=CGAffineTransformIdentity;

[UIViewanimateKeyframesWithDuration:0.5delay:0options:0animations: ^{

[UIViewaddKeyframeWithRelativeStartTime:0relativeDuration:1/3.0animations: ^{

button.transform=CGAffineTransformMakeScale(1.5,1.5);

}];

[UIViewaddKeyframeWithRelativeStartTime:1/3.0relativeDuration:1/3.0animations: ^{

button.transform=CGAffineTransformMakeScale(0.8,0.8);

}];

[UIViewaddKeyframeWithRelativeStartTime:2/3.0relativeDuration:1/3.0animations: ^{

button.transform=CGAffineTransformMakeScale(1.0,1.0);

}];

}completion:nil];

你可能感兴趣的:(button 点击一下跳动的效果)