iOS点击按钮放大后缩小效果

释放双眼,带上耳机,听听看~!

点击按钮放大后缩小效果

类似QQ、微信在相册选择时,选中按钮时的特效。(代码源于网络,侵权删)


代码

- (void)addButtonAnimation {
UIButton *button = _contentView.coinButton;
button.transform = CGAffineTransformIdentity;
[UIView animateKeyframesWithDuration:0.5 delay:0 options:0 animations: ^{
[UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1 / 3.0 animations: ^{
button.transform = CGAffineTransformMakeScale(1.5, 1.5);
}];
[UIView addKeyframeWithRelativeStartTime:1/3.0 relativeDuration:1/3.0 animations: ^{
button.transform = CGAffineTransformMakeScale(0.8, 0.8);
}];
[UIView addKeyframeWithRelativeStartTime:2/3.0 relativeDuration:1/3.0 animations: ^{
button.transform = CGAffineTransformMakeScale(1.0, 1.0);
}];
} completion:nil];
}

 

人已赞赏
iOS文章

iOS AVPlayer seektotime 精准定位

2020-5-18 21:01:48

iOS文章

iOS tagged pointer

2020-5-18 22:16:49

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索