Score
0
Watch 22 Star 54 Fork 22

Mr-R-yan / RW_DropdownMenuObjective-C

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
自己写的一款简单的下拉二级菜单 (样子仿照大众点评)、自动记录上次选择。 使用者可以根据需要使用下拉二级菜单或一级下拉菜单 spread retract

https://github.com/Ryan-Wong-iOS/RW_DropdownMenu.git

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

RW_DropdownMenu

Import

导入头文件DropdownMenu.h

How To Use

实现初始化

  • (id)initDropdownWithButtonTitles:(NSArray*)titles andLeftListArray:(NSArray*)leftArray andRightListArray:(NSArray *)rightArray;
  • 例如:
  • DropdownMenu *dropdown = [[DropdownMenu alloc] initDropdownWithButtonTitles:_titleArray andLeftListArray:_leftArray andRightListArray:_rightArray];
    dropdown.delegate = self; //此句的代理方法可返回选中下标值
    [self.view addSubview:dropdown.view];

Delegate

//实现代理,返回选中的下标,若左边没有列表,则返回0。ButtonIndex为打开的第几个按钮或列表下标,left为左边选中下标,right为右边选中下标

  • (void)dropdownSelectedButtonIndex:(NSString *)index LeftIndex:(NSString *)left RightIndex:(NSString *)right { NSLog(@"%s : You choice button %@, left %@ and right %@", FUNCTION, index, left, right); }

Thanks

感谢大家对我的支持,最近做了一些小更新; <br/ >2016-04-21 -- 增加返回选的第几个button(或者选中的是第几个列表);选中后button显示选中值

Demo

image

Comments ( 2 )

Sign in for post a comment

Objective-C
1
https://gitee.com/RyanPeng/RW_DropdownMenu.git
git@gitee.com:RyanPeng/RW_DropdownMenu.git
RyanPeng
RW_DropdownMenu
RW_DropdownMenu
master

Search

231008 48f1a665 1899542 231017 9a6720c6 1899542