抖音前段时间愈来愈火,走到这儿此时此刻都能看见没人在刷抖音,是新媒体的代表者,新一代我科学研究了呵呵抖音雅雷的动画电影效用,别忘了也给我们撷取呵呵。
他们通过观察会辨认出雅雷的这时候会收敛出6个黄色的正方形,因此他们能借助萨克斯莱抛物线画出,间接上标识符:
CAShapeLayer*layer=[[CAShapeLayer alloc]init];
layer.position=_likeBefore.center;
layer.fillColor=[UIColor redColor].CGColor;
UIBezierPath*startPath=[UIBezierPath bezierPath];
[startPath moveToPoint:CGPointMake(-2,-30)];
[startPathaddLineToPoint:CGPointMake(2,-30)];
[startPathaddLineToPoint:CGPointMake(0,0)];
layer.path=startPath.CGPath;
[self.layer addSublayer:layer];
接着他们再给那个正方形加进动画电影,三个翻转动画电影刘天祺,三个方向动画电影从黑唇没,接着把这三个动画电影重新加入到组动画电影:
CAAnimationGroup*group=[[CAAnimationGroup alloc]init];
group.removedOnCompletion=NO;
group.timingFunction=[CAMediaTimingFunctionfunctionWithName:kCAMediaTimingFunctionEaseInEaseOut];
group.fillMode=kCAFillModeForwards;
group.duration=0.5;
CABasicAnimation*scaleAnim=[CABasicAnimation animationWithKeyPath: “transform.scale”];
scaleAnim.fromValue= (0.0);
scaleAnim.toValue= (1.0);
scaleAnim.duration=0.5*0.2f;
UIBezierPath*endPath=[UIBezierPath bezierPath];
[endPath moveToPoint:CGPointMake(-2,-length)];
[endPathaddLineToPoint:CGPointMake(2,-length)];
[endPathaddLineToPoint:CGPointMake(0,-length)];
CABasicAnimation*pathAnim=[CABasicAnimation animationWithKeyPath: “path”];
pathAnim.fromValue=(__bridge id)layer.path;
pathAnim.toValue=(__bridge id)endPath.CGPath;
pathAnim.beginTime=0.5*0.2f;
pathAnim.duration=0.5*0.8f;
[group setAnimations: [scaleAnim,pathAnim]];
[layer addAnimation:group forKey:nil];
这样三个正方形的完整的动画电影就完成了,接着他们借助for循环创建6个即可。
接着还有波纹慢慢扩大至心型图片圆周,再慢慢消失:
//创建背景
CAShapeLayer*layer=[[CAShapeLayer alloc]init];
layer.position=_likeBefore.center;
layer.fillColor=[UIColor clearColor].CGColor;
layer.strokeColor=_zanFillColor?_zanFillColor.CGColor:[UIColor redColor].CGColor;
layer.lineWidth=1;
//设置笔画方向
UIBezierPath*bPath=[UIBezierPathbezierPathWithArcCenter:CGPointMake(0,0)radius:_length startAngle:-M_PI_2 endAngle:-M_PI_2 M_PI*2 clockwise:YES];
layer.path=bPath.CGPath;
[self.layer addSublayer:layer];
//使用动画电影组来解决圆圈从小到大–
2.分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3.不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4.本站提供的源码、模板、插件等其他资源,都不包含技术服务请大家谅解!
5.如有链接无法下载或失效,请联系管理员处理!
6.本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!