iOS 画个线图片随之移动

UIBezierPath * path11 = [UIBezierPath bezierPath];

    //参数依次是:圆心坐标,半径,开始弧度,结束弧度  画线方向:yes为顺时针,no为逆时针    [path11 addArcWithCenter:CGPointMake(87+72, 40+72) radius:68 startAngle:-90*M_PI/180 endAngle:1*(scrore*3.6)*M_PI/180-90*M_PI/180 clockwise:TRUE];

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

    pathAnimation.calculationMode = kCAAnimationPaced;

    pathAnimation.fillMode = kCAFillModeForwards;

    pathAnimation.removedOnCompletion = NO;

    pathAnimation.path = path11.CGPath;

    pathAnimation.duration = 5.0f;

    [moveImg.layer addAnimation:pathAnimation forKey:@"pathAnimation"];

你可能感兴趣的:(iOS 画个线图片随之移动)