1717
1818@interface TopicCommentCell ()<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
1919@property (strong , nonatomic ) UIImageView *ownerIconView;
20- @property (strong , nonatomic ) UILabel *contentLabel, * timeLabel;
20+ @property (strong , nonatomic ) UILabel *timeLabel;
2121@property (strong , nonatomic ) UICustomCollectionView *imageCollectionView;
2222@end
2323
@@ -37,9 +37,11 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
3737 }
3838 CGFloat curWidth = kScreen_Width - 40 - 2 *kPaddingLeftWidth ;
3939 if (!_contentLabel) {
40- _contentLabel = [[UILabel alloc ] initWithFrame: CGRectMake (kPaddingLeftWidth + 40 , curBottomY, curWidth, 30 )];
40+ _contentLabel = [[UITTTAttributedLabel alloc ] initWithFrame: CGRectMake (kPaddingLeftWidth + 40 , curBottomY, curWidth, 30 )];
4141 _contentLabel.textColor = [UIColor colorWithHexString: @" 0x555555" ];
4242 _contentLabel.font = kTopicCommentCell_FontContent ;
43+ _contentLabel.linkAttributes = kLinkAttributes ;
44+ _contentLabel.activeLinkAttributes = kLinkAttributesActive ;
4345 [self .contentView addSubview: _contentLabel];
4446 }
4547 CGFloat commentBtnWidth = 40 ;
@@ -76,6 +78,13 @@ - (void)setToComment:(ProjectTopic *)toComment{
7678 CGFloat curWidth = kScreen_Width - 40 - 2 *kPaddingLeftWidth ;
7779 [_ownerIconView sd_setImageWithURL: [_toComment.owner.avatar urlImageWithCodePathResizeToView: _ownerIconView] placeholderImage: kPlaceholderMonkeyRoundView (_ownerIconView)];
7880 [_contentLabel setLongString: _toComment.content withFitWidth: curWidth];
81+
82+ for (HtmlMediaItem *item in _toComment.htmlMedia .mediaItems ) {
83+ if (item.displayStr .length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
84+ [_contentLabel addLinkToTransitInformation: [NSDictionary dictionaryWithObject: item forKey: @" value" ] withRange: item.range];
85+ }
86+ }
87+
7988 curBottomY += [_toComment.content getHeightWithFont: kTopicCommentCell_FontContent constrainedToSize: CGSizeMake (curWidth, CGFLOAT_MAX)] + 5 ;
8089
8190 NSInteger imagesCount = _toComment.htmlMedia .imageItems .count ;
0 commit comments