处理滚动底部问题
This commit is contained in:
@@ -424,12 +424,12 @@ static NSString *const kCommentFooterIdentifier = @"CommentFooter";
|
||||
// 更新模型状态
|
||||
if (isNowLiked) {
|
||||
// 点赞成功:喜欢数+1
|
||||
reply.isLiked = YES;
|
||||
reply.liked = YES;
|
||||
reply.likeCount = MAX(0, reply.likeCount + 1);
|
||||
NSLog(@"[KBAICommentView] 二级评论点赞成功,ID: %ld", (long)commentId);
|
||||
} else {
|
||||
// 取消点赞成功:喜欢数-1
|
||||
reply.isLiked = NO;
|
||||
reply.liked = NO;
|
||||
reply.likeCount = MAX(0, reply.likeCount - 1);
|
||||
NSLog(@"[KBAICommentView] 二级评论取消点赞成功,ID: %ld", (long)commentId);
|
||||
}
|
||||
|
||||
@@ -133,13 +133,14 @@
|
||||
self.timeLabel.text = [reply formattedTime];
|
||||
|
||||
// 点赞
|
||||
NSString *likeText = reply.likeCount > 0 ? [self formatLikeCount:reply.likeCount] : @"";
|
||||
self.likeButton.textLabel.text = likeText;
|
||||
NSString *likeText =
|
||||
reply.likeCount > 0 ? [self formatLikeCount:reply.likeCount] : @"赞";
|
||||
self.likeButton.textLabel.text = likeText;
|
||||
|
||||
UIImage *likeImage = reply.isLiked ? [UIImage systemImageNamed:@"heart.fill"]
|
||||
: [UIImage systemImageNamed:@"heart"];
|
||||
self.likeButton.iconView.image = likeImage;
|
||||
self.likeButton.iconView.tintColor = reply.isLiked ? [UIColor systemRedColor] : [UIColor grayColor];
|
||||
UIImage *likeImage = reply.liked
|
||||
? [UIImage imageNamed:@"comment_sel_icon"]
|
||||
: [UIImage imageNamed:@"comment_nor_icon"];
|
||||
self.likeButton.iconView.image = likeImage;
|
||||
}
|
||||
|
||||
- (NSString *)formatLikeCount:(NSInteger)count {
|
||||
@@ -225,10 +226,10 @@
|
||||
_likeButton = [[KBTopImageButton alloc] init];
|
||||
_likeButton.iconSize = CGSizeMake(16, 16);
|
||||
_likeButton.spacing = 2;
|
||||
_likeButton.iconView.image = [UIImage systemImageNamed:@"heart"];
|
||||
_likeButton.iconView.image = [UIImage imageNamed:@"comment_nor_icon"];
|
||||
_likeButton.iconView.tintColor = [UIColor grayColor];
|
||||
_likeButton.textLabel.font = [UIFont systemFontOfSize:10];
|
||||
_likeButton.textLabel.textColor = [UIColor grayColor];
|
||||
_likeButton.textLabel.font = [UIFont systemFontOfSize:10];
|
||||
_likeButton.textLabel.textColor = [UIColor colorWithHex:0xC5BEB4];
|
||||
[_likeButton addTarget:self
|
||||
action:@selector(likeButtonTapped)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
Reference in New Issue
Block a user