• Stars
    star
    152
  • Rank 244,685 (Top 5 %)
  • Language
    Objective-C
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Imitation of nailing frosted glass pop-up menu, simple implementation, code comments.

BlurEffectMenu

仿钉钉的毛玻璃弹出菜单,比较简单的实现,代码有注释。

#使用方法:

BlurEffectMenuItem *addMattersItem=[[BlurEffectMenuItem alloc]init];
[addMattersItem setTitle:@"添加事项"];
[addMattersItem setIcon:[UIImage imageNamed:@"addMatters"]];

BlurEffectMenuItem *addSchedulesItem=[[BlurEffectMenuItem alloc]init];
[addSchedulesItem setTitle:@"添加日程"];
[addSchedulesItem setIcon:[UIImage imageNamed:@"addSchedule"]];

BlurEffectMenuItem *setupChatItem=[[BlurEffectMenuItem alloc]init];
[setupChatItem setTitle:@"发起会话"];
[setupChatItem setIcon:[UIImage imageNamed:@"setupChat"]];

BlurEffectMenuItem *searchContactsItem=[[BlurEffectMenuItem alloc]init];
[searchContactsItem setTitle:@"查找联系人"];
[searchContactsItem setIcon:[UIImage imageNamed:@"searchContacts"]];


BlurEffectMenu *menu=[[BlurEffectMenu alloc]initWithMenus:@[addMattersItem,addSchedulesItem,setupChatItem,searchContactsItem]];
[menu setDelegate:self];
menu.modalPresentationStyle = UIModalPresentationOverFullScreen;
[menu setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentViewController:menu animated:YES completion:nil];

#BlurEffectMenu Delegate

//点击背景dismiss
- (void)blurEffectMenuDidTapOnBackground:(BlurEffectMenu *)menu;

//点击每个item
- (void)blurEffectMenu:(BlurEffectMenu *)menu didTapOnItem:(BlurEffectMenuItem *)item;

#效果图:

image