`
374016526
  • 浏览: 95181 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

CALayer 按指定的点 运动

阅读更多

CGMutablePathRef thePath = CGPathCreateMutable();

 

        CGPathMoveToPoint(thePath,NULL,aLayer.position.x, aLayer.position.y - 10);

        CGPathAddCurveToPoint(thePath,NULL,

                              aLayer.position.x, aLayer.position.y - 30,

                              aLayer.position.x, aLayer.position.y - 50,

                              aPoint.x, aPoint.y);

 

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

        theAnimation.path = thePath;

        theAnimation.duration = duration;

 

        CFRelease(thePath);

 

        theAnimation.removedOnCompletion = YES;

 

        [aLayer addAnimation:theAnimation forKey:@"position"];

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics