AwesomeMenu,仿Path主菜单功能

花色主页: AwesomeMenu
项目主页

实例下载: 流行源代码点击下载

故而法简介:

通过创办菜单各个单元项来创造菜单:

UIImage *storyMenuItemImage = [UIImage imageNamed:@"bg-menuitem.png"];
UIImage *storyMenuItemImagePressed = [UIImage imageNamed:@"bg-menuitem-highlighted.png"];
UIImage *starImage = [UIImage imageNamed:@"icon-star.png"];
AwesomeMenuItem *starMenuItem1 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
                                                           highlightedImage:storyMenuItemImagePressed
                                                               ContentImage:starImage
                                                    highlightedContentImage:nil];
AwesomeMenuItem *starMenuItem2 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
                                                           highlightedImage:storyMenuItemImagePressed
                                                               ContentImage:starImage
                                                    highlightedContentImage:nil];
// "开始"单元格,类似于 Path 的"添加"按钮.
AwesomeMenuItem *startItem = [[AwesomeMenuItem alloc] initWithImage:[UIImage imageNamed:@"bg-addbutton.png"]
                                                   highlightedImage:[UIImage imageNamed:@"bg-addbutton-highlighted.png"]
                                                       ContentImage:[UIImage imageNamed:@"icon-plus.png"]
                                            highlightedContentImage:[UIImage imageNamed:@"icon-plus-highlighted.png"]];

下一场,初始化菜单与选:

AwesomeMenu *menu = [[AwesomeMenu alloc] initWithFrame:self.window.bounds startItem:startItem optionMenus:[NSArray arrayWithObjects:starMenuItem1, starMenuItem2]];
menu.delegate = self;
[self.window addSubview:menu];

而吧足以利用下菜单的相继属性,自定义:

复确定”添加”按钮的职务:

menu.startPoint = CGPointMake(160.0, 240.0);

装旋转角度:

menu.rotateAngle = 0.0;

安装总体菜单的按钮角度:

menu.menuWholeAngle = M_PI * 2;

安每个菜2018正版葡京赌侠诗单项中动画延迟执行的时间距离:

menu.timeOffset = 0.036f;

适于弹动动画:

menu.farRadius = 140.0f;
menu.nearRadius = 110.0f;

安”添加菜单”与其他菜单单元格之间的去:

menu.endRadius = 120.0f;

发表评论

电子邮件地址不会被公开。 必填项已用*标注