We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
以下是调用代码
[ZQTools cleanViewSubviews:self.contentView]; self.tagSelectView = [[TTGTextTagCollectionView alloc] init]; self.tagSelectView.delegate = self; [self.contentView addSubview:self.tagSelectView]; [self.tagSelectView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(Scale(15)); make.right.offset(Scale(-15)); make.top.offset(Scale(15)); make.bottom.offset(Scale(-15)); }]; // Alignment self.tagSelectView.alignment = TTGTagCollectionAlignmentLeft;
// Use manual calculate height self.tagSelectView.manualCalculateHeight = YES; TTGTextTagStringContent *content = [TTGTextTagStringContent new]; TTGTextTagStringContent *selectedContent = [TTGTextTagStringContent new]; TTGTextTagStyle *style = [TTGTextTagStyle new]; TTGTextTagStyle *selectedStyle = [TTGTextTagStyle new]; content.textFont = TcFont(13); selectedContent.textFont = content.textFont; content.textColor = rgba(117, 120, 130, 1); selectedContent.textColor = [UIColor whiteColor]; style.backgroundColor = rgba(248, 249, 250, 1); selectedStyle.backgroundColor = rgba(255, 102, 133, 1); style.borderColor = [UIColor colorWithRed:0.18 green:0.19 blue:0.22 alpha:1.00]; style.borderWidth = 0; selectedStyle.borderColor = [UIColor colorWithRed:0.18 green:0.19 blue:0.22 alpha:1.00]; selectedStyle.borderWidth = 0; style.shadowColor = [UIColor grayColor]; style.shadowOffset = CGSizeMake(0, 0); style.shadowOpacity = 0.f; style.shadowRadius = 0; selectedStyle.shadowColor = [UIColor greenColor]; selectedStyle.shadowOffset = CGSizeMake(0, 0); selectedStyle.shadowOpacity = 0.f; selectedStyle.shadowRadius = 0; style.cornerRadius = Scale(15); selectedStyle.cornerRadius = Scale(15); style.extraSpace = CGSizeMake(Scale(20), Scale(17)); selectedStyle.extraSpace = style.extraSpace; NSMutableArray *tags = [NSMutableArray new]; for (int i = 0;i < self.tagArr.count;i++) { CommonModel *model = [CommonModel mj_objectWithKeyValues:self.tagArr[i]]; TTGTextTagStringContent *stringContent = [content copy]; stringContent.text = model.name; TTGTextTagStringContent *selectedStringContent = [selectedContent copy]; selectedStringContent.text = model.name; TTGTextTag *tag = [TTGTextTag new]; tag.content = stringContent; tag.selectedContent = selectedStringContent; tag.style = style; tag.selectedStyle = selectedStyle; [tags addObject:tag.copy]; } [self.tagSelectView addTags:tags]; // Use manual height, update preferredMaxLayoutWidth self.tagSelectView.preferredMaxLayoutWidth = _mainW - Scale(30); [self selectedTagReset]; [self.tagSelectView reload];
The text was updated successfully, but these errors were encountered:
@ccchzxj 我试了你提供的Demo代码,但是问题无法复现
Sorry, something went wrong.
No branches or pull requests
以下是调用代码
[ZQTools cleanViewSubviews:self.contentView];
self.tagSelectView = [[TTGTextTagCollectionView alloc] init];
self.tagSelectView.delegate = self;
[self.contentView addSubview:self.tagSelectView];
[self.tagSelectView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.offset(Scale(15));
make.right.offset(Scale(-15));
make.top.offset(Scale(15));
make.bottom.offset(Scale(-15));
}];
// Alignment
self.tagSelectView.alignment = TTGTagCollectionAlignmentLeft;
The text was updated successfully, but these errors were encountered: