IFMMenu 1.0.3

IFMMenu 1.0.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Aug 2017

Maintained by liugangios.



IFMMenu 1.0.3

  • By
  • liugangios

仿微信首页添加菜单

Demo展示

展示图

GIF展示

动图.gif

安装

手动安装

  1. 下载IFMMenu文件夹内的所有内容。
  2. IFMMenu内的源文件添加(拖放)到你的工程。
  3. 导入IFMMenu.h

使用

NSMutableArray *menuItems = [[NSMutableArray alloc] initWithObjects:
                                 
         [IFMMenuItem itemWithImage:[UIImage imageNamed:@"address_icon_share"]
                              title:@"分享一下"
                             action:^(IFMMenuItem *item) {
                                 NSLog(@"分享一下");
                             }],
         [IFMMenuItem itemWithImage:[UIImage imageNamed:@"address_icon_modify"]
                              title:@"关注一下"
                             action:^(IFMMenuItem *item) {
                                 NSLog(@"关注一下");
                             }], nil];
    
IFMMenu *menu = [[IFMMenu alloc] initWithItems:menuItems];

[menu showFromRect:sender.frame inView:self.view];

除了这种展示方法,还提供了从导航栏和TabBar弹出的方法

[menu showFromNavigationController:self.navigationController WithX:100];
[menu showFromTabBarController:self.tabBarController WithX:100];

个性化设置

支持弹出框的多种自定义设置

menu.menuBackgroundStyle = IFMMenuBackgroundStyleLight; //menu样式
menu.edgeInsets = UIEdgeInsetsMake(30, 20, 50, 10); //下拉框的内边距
menu.gapBetweenImageTitle = 50; //图片和标题间距
menu.arrowHight = 20;   //指向控件的箭头的高度
menu.menuBackGroundColor = [UIColor orangeColor];   //背景颜色
menu.minMenuItemHeight = 45;    //Item最小高度
menu.minMenuItemWidth = 100;    //Item最小宽度
menu.titleFont = [UIFont systemFontOfSize:20];  //Item字体
menu.segmenteLineColor = [UIColor blueColor];   //分割线颜色
menu.titleColor = [UIColor greenColor]; //Item颜色
menu.menuSegmenteLineStyle = IFMMenuSegmenteLineStyleFill;  //分割线类型
menu.menuCornerRadiu = 20;  //menu的圆角大小
menu.showShadow = NO;   //是否显示阴影