SFTagView

by shiweifu

shiweifu /SFTagView

一个可复用的tagView [DEPRECATED] [use https://github.com/shiweifu/DPTagView for insteaded.]

130 Stars 169 Forks Last release: Not found Other 21 Commits 8 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

[DEPRECATED]
[use https://github.com/shiweifu/DPTagView for insteaded.]

使用 View 实现的 Tag视图,不用再使用CollectionView

时过境迁,因为性能和复用性的考虑,本库去掉使用AutoLayout来实现,如果你想使用AutoLayout版,可以使用这个:https://github.com/zsk425/SKTagView

使用说明

- (void)setupTagView
{

NSArray *texts = @[ @"A", @"Short", @"Button", @"Longer Button", @"Very Long Button", @"Short", @"More Button", @"Any Key"];

[texts enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { SFTag *tag = [SFTag tagWithText:obj]; tag.textColor = [UIColor blackColor]; tag.bgColor = [UIColor yellowColor];

[self.tagView addTag:tag];

}];

[self.view addSubview:self.tagView];

[self.tagView autoCenterInSuperview];

[self.tagView autoSetDimension:ALDimensionWidth toSize:220]; }

详情见图:

预览图

预览图

预览图

Swift 正在更新中

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.