我想在一个圆的圆周上旋转五个按钮(圆心(120,120),它实际上是方形视图的中心,即240 * 240),半径为100。可以这样做,通过与正在旋转的按钮以及适当的外观进行交互。五个按钮保持相等距离的圆形旋转
我曾尝试 '
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);'
旋转,但它产生怪异的路径。在三角形的方式.. (' 地图”, '分享' ,'slideShow','website')我的按钮..:P
你的“angl”辐射?它一定要是。 radAngl = angl/180 * Pi。 另外:不要基于以前的坐标的下一个迭代。只增加角度并使用初始位置计算位置。 – Krumelur 2011-03-25 14:19:34
不,这是我正在递减的角度 – rptwsthi 2011-03-25 14:25:11
@vladimir:你能告诉我你是怎么做到的吗? :) – rptwsthi 2011-03-25 14:26:07