如上图所示,一款高大上的下拉列表给大家看看!!!
PTLDownMenuList
下拉列表
简单用法
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
代理协议
-(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地址:https://github.com/soliloquy-local/PTLDownMenuList.git
网友评论