dev-zlcode / SFTagView

一个可复用的tagView

Home Page:float.leanote.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

使用 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];
}

详情见图:

预览图

预览图

预览图

About

一个可复用的tagView

float.leanote.com

License:MIT License


Languages

Language:Objective-C 95.0%Language:Ruby 5.0%