@@ -98,7 +98,8 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
9898 self.contentLabel .font = kTweet_ContentFont ;
9999 self.contentLabel .textColor = kColorDark3 ;
100100 self.contentLabel .numberOfLines = 0 ;
101-
101+ self.contentLabel .lineHeightMultiple = 1.2 ;
102+
102103 self.contentLabel .linkAttributes = kLinkAttributes ;
103104 self.contentLabel .activeLinkAttributes = kLinkAttributesActive ;
104105 self.contentLabel .delegate = self;
@@ -377,9 +378,23 @@ + (CGFloat)cellHeightWithObj:(id)obj needTopView:(BOOL)needTopView{
377378
378379+ (CGFloat)contentLabelHeightWithTweet : (Tweet *)tweet {
379380 CGFloat height = 0 ;
381+ // if (tweet.content.length > 0) {
382+ // height += MIN(kTweet_ContentMaxHeight, [tweet.content getHeightWithFont:kTweet_ContentFont constrainedToSize:CGSizeMake(kTweetCell_ContentWidth, CGFLOAT_MAX)]);
383+ // height += 15;
384+ // }
385+ static UITTTAttributedLabel *p_contentLabel = nil ;
380386 if (tweet.content .length > 0 ) {
381- height += MIN (kTweet_ContentMaxHeight , [tweet.content getHeightWithFont: kTweet_ContentFont constrainedToSize: CGSizeMake (kTweetCell_ContentWidth , CGFLOAT_MAX)]);
382- height += 15 ;
387+ if (!p_contentLabel) {
388+ p_contentLabel = [[UITTTAttributedLabel alloc ] initWithFrame: CGRectMake (kTweetCell_PadingLeft , kTweetCell_PadingTop , kTweetCell_ContentWidth , 20 )];
389+ p_contentLabel.font = kTweet_ContentFont ;
390+ p_contentLabel.textColor = kColorDark3 ;
391+ p_contentLabel.numberOfLines = 0 ;
392+ p_contentLabel.lineHeightMultiple = 1.2 ;
393+ p_contentLabel.linkAttributes = kLinkAttributes ;
394+ p_contentLabel.activeLinkAttributes = kLinkAttributesActive ;
395+ }
396+ [p_contentLabel setLongString: tweet.content withFitWidth: kTweetCell_ContentWidth maxHeight: kTweet_ContentMaxHeight ];
397+ height += p_contentLabel.height + 15 ;
383398 }
384399 return height;
385400}
0 commit comments