# RW_DropdownMenu **Repository Path**: Ajrui/RW_DropdownMenu ## Basic Information - **Project Name**: RW_DropdownMenu - **Description**: 自己写的一款简单的下拉二级菜单 (样子仿照大众点评)、自动记录上次选择。 使用者可以根据需要使用下拉二级菜单或一级下拉菜单 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: https://github.com/Ryan-Wong-iOS/RW_DropdownMenu.git - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 23 - **Created**: 2015-10-27 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 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。left为左边选中下标,right为右边选中下标 - (void)dropdownSelectedLeftIndex:(NSString *)left RightIndex:(NSString *)right; { NSLog(@"%s : You choice %@ and %@", __FUNCTION__, left, right); } ### Demo ![image](https://github.com/Ryan-Wong-iOS/RW_DropdownMenu/raw/master/RW_DropdownMenu/demo.gif)