美文网首页
ios隐性动画--- 加贝塞尔曲线运动

ios隐性动画--- 加贝塞尔曲线运动

作者: seventhboy | 来源:发表于2016-11-23 17:15 被阅读217次

------------------------------------凌乱的分割线----------------------------------------

加贝塞尔曲线运动

CAKeyframeAnimation *positionAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];

positionAnimation.calculationMode = kCAAnimationPaced;
positionAnimation.fillMode = kCAFillModeForwards;
positionAnimation.removedOnCompletion = NO;
positionAnimation.repeatCount = 0;

CGMutablePathRef curvedPath = CGPathCreateMutable();
UIBezierPath *cutePath = [UIBezierPath bezierPath];
[cutePath moveToPoint:fpoint];
[cutePath addCurveToPoint:tpoint controlPoint1:point1 controlPoint2:point2]; //贝塞尔曲线
CGPathAddPath(curvedPath, 0, cutePath.CGPath);
positionAnimation.path = curvedPath;
CGPathRelease(curvedPath);

相关文章

网友评论

      本文标题:ios隐性动画--- 加贝塞尔曲线运动

      本文链接:https://www.haomeiwen.com/subject/vyyvpttx.html