CALayer 坐标转换的问题 x,y是相对于_btn的,你用x、y = -半径试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 建议使用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"]; 参考这个,绘制 http://nachbaur.com/blog/core-animation-part-4 谢谢 我还是想知道 我的方法里面 的 x y 应该怎么计算出来。x= 240 - 100 y = 160 - 100 http://www.mibugs.com/2014/05/18/%E5%8A%A8%E7%94%BB%E8%A7%A3%E9%87%8A/ x=-80 y=20 即是x=所求的240-(btn的位置设置220+100运动轨迹的半径值) 即是y=所求的160-(btn的位置设置40+100运动轨迹的半径值) 创建CAKeyframeAnimation, 用CGPath生成一个圆的path, 就完事 nmi hjsdasud [huydboashd;laskhdv;ksaldsda COCOS2D-X背景音乐播放与暂停问题 关于定义实例变量的问题 IB问题 storyboard导航返回后,怎样返回前视图的数据 关于self.navgationController为nil的问题。 关于IPhone横屏竖屏切换 Iphone開發如何在運行項目的時候調用java寫的webservice tableview 全选问题 iOS推送的问题 这是怎么啦?界面不刷新!! 新手,请大家帮忙解答一下,不甚感激 请教 怎样调整 Tab Bar的 item 顺序, 请前辈指导下!
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"];
y = 160 - 100