iOS点击button放大后缩小效果

r囧r小猫 2022-07-12 13:38 363阅读 0赞
  1. -(void)buttonClick{
  2. button.transform = CGAffineTransformIdentity;
  3. [UIView animateKeyframesWithDuration:0.5 delay:0 options:0 animations: ^{
  4. [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1 / 3.0 animations: ^{
  5. button.transform = CGAffineTransformMakeScale(1.5, 1.5);
  6. }];
  7. [UIView addKeyframeWithRelativeStartTime:1/3.0 relativeDuration:1/3.0 animations: ^{
  8. button.transform = CGAffineTransformMakeScale(0.8, 0.8);
  9. }];
  10. [UIView addKeyframeWithRelativeStartTime:2/3.0 relativeDuration:1/3.0 animations: ^{
  11. button.transform = CGAffineTransformMakeScale(1.0, 1.0);
  12. }];
  13. } completion:nil];
  14. }

转载请注明出处:http://blog.csdn.net/chen_gp_x

发表评论

表情:
评论列表 (有 0 条评论,363人围观)

还没有评论,来说两句吧...

相关阅读