给视图一个像心跳的动画

来源:互联网 发布:长春大学网络教学平台 编辑:程序博客网 时间:2024/06/06 02:02

1. 给视图一个像心跳的动画

CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"];anim.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.1, 1.1, 1)];anim.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];anim.repeatCount = HUGE_VALF;anim.autoreverses = YES;[lp.view.layer addAnimation:anim forKey:nil];

2. 取消

[lp.view.layer removeAllAnimations];



0 0
原创粉丝点击