iOS下拉列表

作者: ptlCoder | 来源:发表于2017-11-24 15:07 被阅读16次
GIF.gif

如上图所示,一款高大上的下拉列表给大家看看!!!

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

相关文章

网友评论

    本文标题:iOS下拉列表

    本文链接:https://www.haomeiwen.com/subject/hbcfbxtx.html