Skip to content
New issue

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

单cell显示异常 #143

Open
ccchzxj opened this issue May 15, 2023 · 1 comment
Open

单cell显示异常 #143

ccchzxj opened this issue May 15, 2023 · 1 comment

Comments

@ccchzxj
Copy link

ccchzxj commented May 15, 2023

image tableview里面嵌套使用textTagCollection,头部会出现单条线,单次调试多次点击会随机出现,先前以为是背景颜色的原因,更新到2.4.2后仍然出现

以下是调用代码

[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];
@zekunyan
Copy link
Owner

@ccchzxj 我试了你提供的Demo代码,但是问题无法复现

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants