项目介绍:
一款超级简单的下拉列表demo
用法:
PTLMenuButton *btn = [[PTLMenuButton alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 40) menuTitles:@[@"科室",@"排序"]];
NSArray * listArr1 = @[@"全科",@"妇产科",@"儿科",@"内科",@"外科",@"中医科",@"口腔科",@"耳科",@"耳鼻喉科"];
NSArray * listArr2 = @[@"综合排序",@"评分",@"问诊量",@"价格"];
btn.listTitles = @[listArr1, listArr2];
btn.delegate = self;
[self.view addSubview:btn];
遵循PTLMenuButtonDelegate代理协议:
// PTLMenuButtonDelegate
-(void)ptl_menuButton:(PTLMenuButton *)menuButton didSelectMenuButtonAtIndex:(NSInteger)index selectMenuButtonTitle:(NSString *)title listRow:(NSInteger)row rowTitle:(NSString *)rowTitle{
NSLog(@"index: %zd, title:%@, listrow: %zd, rowTitle: %@", index, title, row, rowTitle);
}
本例子提供了github地址
github: https://github.com/soliloquy-local/PTLDownMenuList.git