KMTagListViewtag标签简单用法 KMTagListView *tag = [[KMTagListView alloc]initWithFrame:CGRectMake(10, 100, self.view.frame.size.width, 0)]; tag.delegate_ = self; [tag setupSubViewsWithTitles:@[@'哈哈哈哈哈哈', @'哈试发',@'哈你发',@'哈哈试会计给你发',@'哈哈你发',@'哈哈哈哈哈发', @'哈哈哈哈哈哈考试会计给你发',@'哈哈哈哈哈发',@'哈哈发',@'哈哈哈哈哈发',@'哈哈计给你发',@'哈哈哈哈哈发',@'哈哈哈发',@'哈哈哈哈哈发',@'哈哈你发',@'哈发']]; [self.view addSubview:tag]; CGRect rect = tag.frame; rect.size.height = tag.contentSize.height; tag.frame = rect;遵循PTLMenuButtonDelegate代理协议 -(void)ptl_TagListView:(KMTagListView *)tagListView didSelectTagViewAtIndex:(NSInteger)index selectContent:(NSString *)content { NSLog(@'content: %@ index: %zd', content, index); }
github可以访问这.