x,y是相对于_btn的,你用x、y = -半径试试

解决方案 »

  1.   

    建议使用UIBezierPath来绘制动画路径 CGPoint arcCenter=CGPointMake(240,160);
    int radius = 100;
    UIBezierPath *circlePath = [UIBezierPath bezierPathWithArcCenter:arcCenter   radius:radius                                              startAngle:DEGREES_TO_RADIANS(270)
                                                          endAngle:DEGREES_TO_RADIANS(-90)
                                                         clockwise:NO];CAKeyframeAnimation *orbit = [CAKeyframeAnimation animation];
    orbit.keyPath = @"position";
    orbit.path =circlePath.CGPath;
    orbit.duration = 4;
    orbit.repeatCount = HUGE_VALF;
    orbit.calculationMode = kCAAnimationPaced;
     orbit.rotationMode = kCAAnimationRotateAuto;
     
     [_btn.layer addAnimation:orbit forKey:@"orbit"];
      

  2.   

    参考这个,绘制 http://nachbaur.com/blog/core-animation-part-4
      

  3.   

    谢谢  我还是想知道  我的方法里面 的 x y 应该怎么计算出来。x= 240 - 100 
    y = 160 - 100
      

  4.   

    http://www.mibugs.com/2014/05/18/%E5%8A%A8%E7%94%BB%E8%A7%A3%E9%87%8A/
      

  5.   

    x=-80 y=20  即是x=所求的240-(btn的位置设置220+100运动轨迹的半径值)  即是y=所求的160-(btn的位置设置40+100运动轨迹的半径值) 
      

  6.   

    创建CAKeyframeAnimation, 用CGPath生成一个圆的path, 就完事
      

  7.   

    nmi hjsdasud [huydboashd;laskhdv;ksaldsda