类似加入购物车的抛物线动画
2016-09-23 17:37
274 查看
CAKeyframeAnimation *keyframeAnimation=[CAKeyframeAnimation animationWithKeyPath:@"position"];//抛物线运动 CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, testView.layer.position.x, testView.layer.position.y);//移动到起始点 CGPathAddQuadCurveToPoint(path, NULL, midPoint.x, midPoint.y, endPoint.x, end.y); keyframeAnimation.path = path; keyframeAnimation.delegate = self; CGPathRelease(path); keyframeAnimation.duration = 2; [testView.layer addAnimation:keyframeAnimation forKey:@"KCKeyframeAnimation_Position"]; //旋转运动 CABasicAnimation *basicAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; basicAnimation.duration = 0.2; basicAnimation.repeatCount = 10; basicAnimation.removedOnCompletion = NO; basicAnimation.toValue = @(M_PI); [testView.layer addAnimation:basicAnimation forKey:@"basic"]; //缩放运动 CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; scaleAnimation.duration = 2; scaleAnimation.toValue = @(0.1); [testView.layer addAnimation:scaleAnimation forKey:@"scale"];
相关文章推荐
- Android 曲线动画animation,类似加入购物车动画
- 仿天猫加入购物车,商品做抛物线动画
- Android贝塞尔曲线实现加入购物车抛物线动画
- 基于jquery fly插件实现加入购物车抛物线动画效果
- 仿天猫加入购物车抛物线动画效果
- Android仿天猫商品抛物线加入购物车动画
- 基于jquery fly插件实现加入购物车抛物线动画效果
- 商品加入购物车抛物线下坠的动画
- clips 前端 js 动画 抛物线加入购物车
- 基于jquery fly插件实现加入购物车抛物线动画效果,jquery.fly.js
- Android 利用二次贝塞尔曲线模仿购物车加入物品抛物线动画
- js加入购物车抛物线动画
- 基于jquery fly插件实现加入购物车抛物线动画效果
- 基于jquery fly插件实现加入购物车抛物线动画效果
- js抛物线动画——加入购物车动效
- iOS 手机淘宝加入购物车动画分析
- Android之仿饿了吗购物车抛物线动画
- 购物车特效-贝塞尔曲线动画(点击添加按钮,产生抛物线动画效果)
- react-native 仿京东加入购物车动画效果
- CSS3 抛物线 加入购物车