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
(void)setupWithLikeItemsArray:(NSArray *)likeItemsArray commentItemsArray:(NSArray *)commentItemsArray { self.likeItemsArray = likeItemsArray; self.commentItemsArray = commentItemsArray;
if (self.commentLabelsArray.count) { [self.commentLabelsArray enumerateObjectsUsingBlock:^(UILabel *label, NSUInteger idx, BOOL *stop) { [label sd_clearAutoLayoutSettings]; label.hidden = YES; //重用时先隐藏所以评论label,然后根据评论个数显示label }]; }
if (!commentItemsArray.count && !likeItemsArray.count) { self.fixedWidth = @(0); // 如果没有评论或者点赞,设置commentview的固定宽度为0(设置了fixedWith的控件将不再在自动布局过程中调整宽度) self.fixedHeight = @(0); // 如果没有评论或者点赞,设置commentview的固定高度为0(设置了fixedHeight的控件将不再在自动布局过程中调整高度) return; } else { self.fixedHeight = nil; // 取消固定宽度约束 self.fixedWidth = nil; // 取消固定高度约束 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
(void)setupWithLikeItemsArray:(NSArray *)likeItemsArray commentItemsArray:(NSArray *)commentItemsArray
{
self.likeItemsArray = likeItemsArray;
self.commentItemsArray = commentItemsArray;
if (self.commentLabelsArray.count) {
[self.commentLabelsArray enumerateObjectsUsingBlock:^(UILabel *label, NSUInteger idx, BOOL *stop) {
[label sd_clearAutoLayoutSettings];
label.hidden = YES; //重用时先隐藏所以评论label,然后根据评论个数显示label
}];
}
if (!commentItemsArray.count && !likeItemsArray.count) {
self.fixedWidth = @(0); // 如果没有评论或者点赞,设置commentview的固定宽度为0(设置了fixedWith的控件将不再在自动布局过程中调整宽度)
self.fixedHeight = @(0); // 如果没有评论或者点赞,设置commentview的固定高度为0(设置了fixedHeight的控件将不再在自动布局过程中调整高度)
return;
} else {
self.fixedHeight = nil; // 取消固定宽度约束
self.fixedWidth = nil; // 取消固定高度约束
}
The text was updated successfully, but these errors were encountered: