第三方库 KxMenu
- (void)add:(UIBarButtonItem *)item
{
NSLog(@"add");
if (isKxMenushow == NO) {
NSArray *menuItems =
@[
[KxMenuItem menuItem:@"添加好友"
image:[UIImage imageNamed:@"moreBtn"]
target:self
action:@selector(AddFriends:)],
[KxMenuItem menuItem:@"新建群聊"
image:[UIImage imageNamed:@"moreBtn"]
target:self
action:@selector(createQun:)],
[KxMenuItem menuItem:@"扫一扫"
image:[UIImage imageNamed:@"moreBtn"]
target:self
action:@selector(SaoMa:)],
// [KxMenuItem menuItem:@"分 享"
// image:[UIImage imageNamed:@"GoodsDetailsSousuo"]
// target:self
// action:@selector(share)],
[KxMenuItem menuItem:@"通讯录" image:[UIImage imageNamed:@"moreBtn"] target:self action:@selector(AddressBook:)]
];
KxMenuItem *first = menuItems[0];
first.foreColor = [UIColor redColor];
//[UIColor colorWithRed:47/255.0f green:112/255.0f blue:225/255.0f alpha:1.0];
first.alignment = NSTextAlignmentCenter;
[KxMenu showMenuInView:self.view
fromRect:CGRectMake(WZScreenWidth - 100, -63, 100, 50)
menuItems:menuItems];
isKxMenushow = YES;
}else if(isKxMenushow == YES){
[KxMenu dismissMenu];
isKxMenushow = NO;
}
}