Coder Social home page Coder Social logo

ifmmenu's Introduction

IFMMenu

仿微信首页添加菜单

Demo展示

展示图

GIF展示

动图.gif

安装

CocoaPods

  1. Podfile 中添加 pod 'IFMMenu'
  2. 执行 pod installpod update
  3. 导入 <IFMMenu/IFMMenu.h>

手动安装

  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;   //是否显示阴影

ifmmenu's People

Contributors

liugangios avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.