【发布时间】:2011-03-25 14:15:04
【问题描述】:
我想在半径为 100 的圆的圆周上旋转五个按钮(圆心为 (120,120),实际上是正方形视图的中心,即 240*240)。是否可以这样做,通过交互带有旋转的按钮和正确的外观。
我试过了'
x = round(cx + redious * cos(angl));
y = round(cy - redious * sin(angl));
NSString *X=[NSString stringWithFormat:@"%f",x];
[xval addObject:[NSString stringWithFormat:@"%@",X]];
NSString *Y=[NSString stringWithFormat:@"%f",y];
[yval addObject:[NSString stringWithFormat:@"%@",Y]];'
计算点数和:
map.frame= CGRectMake([[fqx objectAtIndex:counter1]intValue],[[fqy objectAtIndex:counter1]intValue], 72, 37);
website.frame= CGRectMake([[fqx objectAtIndex:counter2]intValue],[[fqy objectAtIndex:counter2]intValue], 72, 37);
share.frame= CGRectMake([[fqx objectAtIndex:counter3]intValue],[[fqy objectAtIndex:counter3]intValue], 72, 37);
slideShow.frame= CGRectMake([[fqx objectAtIndex:counter4]intValue],[[fqy objectAtIndex:counter4]intValue], 72, 37);'
旋转但它会产生奇怪的路径..以三角形方式.. ('map','share','slideShow','website') 是我的按钮.. :P
【问题讨论】:
-
你的“角度”是径向的吗?它一定要是。 radAngl = 角度 / 180 * Pi。另外:不要将下一次迭代基于以前的坐标。只增加角度,使用初始位置计算位置。
-
不,这是我减一的角度
-
@vladimir:你能告诉我你是怎么做到的吗? :)
-
@rptwsthi,选择您的代码并在问题编辑器中按“{}”按钮。或者只是将代码行缩进 4 个空格
-
做了什么?我还没有实现这样的事情,因此没有答案,但评论中的提示。我认为,您必须先深入研究数学。
标签: iphone objective-c ipad ipod