Giter Club home page Giter Club logo

dkdropdownmenu's Introduction

#DKPopMenu

####Dankal下拉菜单框架,研发中。。。


####使用方法

1.首先你需要创建一个数组去储存你的选项标题

	NSArray *buttonTitles = @[@"按钮一",@"按钮二",@"按钮三",@"按钮四",@"按钮五",@"按钮六",@"按钮七"];  

2.设置popMenu的位置和尺寸

    CGFloat popW = 100;
    CGFloat popH = 200;
    CGFloat popX = self.view.frame.size.width / 2 - popW / 2;
    CGFloat popY = 70;
    
    ALPopMenu *menu = [ALPopMenu showInRect:CGRectMake(popX, popY, popW, popH)];

3.把刚才的数组赋值给buttonTitles属性

	menu.buttonTitles = self.buttonTitles;

4.选择你想要的类型(单选/多选)

    menu.menuType = ALMenuTypeMultiSelections;  //这是多选
    menu.menuType = ALMenuTypeSingleSelection;  // 这是单选

5.如果你想监听下拉菜单里面按钮的点击事件

    menu.popMenuDelegate = self;

6.代理方法如下

/**
 *  当Type为单选 ALMenuTypeSingleSelection 的时候要用到的代理方法
 *
 *  @param btn 当前选择的选项
 */
- (void)singleOptionDidClick:(UIButton *)btn;

/**
 *  当Type为多选 ALMenuTypeMultiSelections 的时候要用到的代理方法
 *
 *  @param currentOption 当前选择的选项
 *  @param options       所有选中的选项
 */
- (void)multiOptionsDidClick:(UITableViewCell *)currentOption allOptions:(NSArray *)options;

隐藏技能

  • 这样子的话可以给你的下拉菜单添加图片
	menu.menuImage = [UIImage imageNamed:@"1"];
    menu.menuType = ALMenuTypeImage;
  • 另外,其实你可以给ALPopMenu实例的contentView属性赋值任何类型的View,然后这个下拉菜单你想显示什么就显示什么,甚至放一个放navigaionController的rootViewController的view进去或许也可以

dkdropdownmenu's People

Contributors

arc-lin 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.