iOS扇形菜单

创建90度扇形坐标数组

- (NSArray *)creatPointArrayWithNumber:(NSInteger)number point:(CGPoint)point r:(CGFloat)r {
    
    NSMutableArray *array = [NSMutableArray array];
    CGFloat f = M_PI_2/(number-1);
    for (int i = 0; i < number; i ++) {
        
        CGFloat y = r * cos(f * i);
        CGFloat x = r * sin(f * i);
        CGPoint newPoint = CGPointMake(point.x - x, point.y - y);
        NSString *pointStr = NSStringFromCGPoint(newPoint);
        [array addObject:pointStr];
    }
    return array;
    
    //得到point:CGPointFromString(array[0]);
}

要展开的时候将扇形坐标赋值给子控件
消失的时候将消失坐标赋值给子控件

你可能感兴趣的:(iOS扇形菜单)