iOS 菜单 PopMenu

1.CocoaPods 集成pod ‘PopMenu’
2.v.m

NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:3];
MenuItem *menuItem = [[MenuItem alloc] initWithTitle:@"Flickr" iconName:@"post_type_bubble_flickr" glowColor:[UIColor grayColor] index:0];
[items addObject:menuItem];

menuItem = [[MenuItem alloc] initWithTitle:@"Googleplus" iconName:@"post_type_bubble_googleplus" glowColor:[UIColor colorWithRed:0.000 green:0.840 blue:0.000 alpha:1.000] index:0];
[items addObject:menuItem];

menuItem = [[MenuItem alloc] initWithTitle:@"Instagram" iconName:@"post_type_bubble_instagram" glowColor:[UIColor colorWithRed:0.687 green:0.000 blue:0.000 alpha:1.000] index:0];
[items addObject:menuItem];

menuItem = [[MenuItem alloc] initWithTitle:@"Twitter" iconName:@"post_type_bubble_twitter" glowColor:[UIColor colorWithRed:0.687 green:0.000 blue:0.000 alpha:1.000] index:0];
[items addObject:menuItem];

menuItem = [[MenuItem alloc] initWithTitle:@"Youtube" iconName:@"post_type_bubble_youtube" glowColor:[UIColor colorWithRed:0.687 green:0.000 blue:0.000 alpha:1.000] index:0];
[items addObject:menuItem];

menuItem = [[MenuItem alloc] initWithTitle:@"Facebook" iconName:@"post_type_bubble_facebook" glowColor:[UIColor colorWithRed:0.687 green:0.000 blue:0.000 alpha:1.000] index:0];
[items addObject:menuItem];

PopMenu *popMenu = [[PopMenu alloc] initWithFrame:self.view.bounds items:items];
popMenu.menuAnimationType = kPopMenuAnimationTypeNetEase; // kPopMenuAnimationTypeSina
popMenu.perRowItemCount = 3; // or 2
[popMenu showMenuAtView:self.view];

3.写属性

@property (nonatomic, assign, readonly) BOOL isShowed;

4.菜单动画格式

@property (nonatomic, assign) PopMenuAnimationType menuAnimationType;

// 有两种:
/** 从下部入 下部出*/
kPopMenuAnimationTypeSina = 0,

/** 从右侧入 左侧出*/
kPopMenuAnimationTypeNetEase = 1,


5.每行有多少列

// Default is 3
@property (nonatomic, assign) NSInteger perRowItemCount;

猜你喜欢

转载自blog.csdn.net/qq_43361450/article/details/83783381