介紹:
環(huán)繞型按鈕,可以當做菜單。點擊某個按鈕,所有按鈕會整體移動,被點擊的按鈕會移動到最頂端。
可以自行修改代碼,但是使用必須實現(xiàn)這些:
CircularLayOutView *manger=[[CircularLayOutView alloc] init];
//manger.tager=self;
manger.MyDelegate=self;
XYPoint *centerPoint=[[XYPoint alloc] i
測試環(huán)境:
測試環(huán)境:Xcode 4.5, iOS 5.0 以上。
效果圖:
使用方法:
環(huán)繞型按鈕,可以當做菜單。點擊某個按鈕,所有按鈕會整體移動,被點擊的按鈕會移動到最頂端。
可以自行修改代碼,但是使用必須實現(xiàn)這些:
CircularLayOutView *manger=[[CircularLayOutView alloc] init];
//manger.tager=self;
manger.MyDelegate=self;
XYPoint *centerPoint=[[XYPoint alloc] init];
centerPoint.xPoint=160;
centerPoint.yPoint=230;
manger.centerPoint=centerPoint;
XYPoint *buttonWeightAndHeight=[[XYPoint alloc] init];
buttonWeightAndHeight.xPoint=40;
buttonWeightAndHeight.yPoint=40;
manger.buttonWeightAndHeight=buttonWeightAndHeight;
manger.radius=100;
NSArray *buttonNameArray=@[@“按鈕1”,@“按鈕2”,@“按鈕3”,@“按鈕4”,@“按鈕5”,@“按鈕6”];
NSMutableArray *imageArr=[[NSMutableArray alloc] initWithCapacity:0];
for (int i=0; i<buttonNameArray.count; i++) {
if(i>8)
{
i=8;
}
[imageArr addObject:[UIImage imageNamed:[NSString stringWithFormat:@“%d.png”,i]]];
}
manger.buttonCount=6;
manger.buttonIndexNameArray=buttonNameArray;
manger.buttonIndexBackGroundArray=imageArr;
[manger creatUIToView:self.view target:nil];
[self.view addSubview:manger];