|
@@ -107,7 +107,7 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
_contentLabel.font = [UIFont systemFontOfSize:contentLabelFontSize];
|
|
|
_contentLabel.numberOfLines = 0;
|
|
|
if (maxContentLabelHeight == 0) {
|
|
|
- maxContentLabelHeight = _contentLabel.font.lineHeight * 3;
|
|
|
+ maxContentLabelHeight = 20 * 3;
|
|
|
}
|
|
|
|
|
|
_moreButton = [UIButton new];
|
|
@@ -244,7 +244,8 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
NSString *userImg = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl, model.userImg];
|
|
|
[_iconView sd_setImageWithURL:[NSURL URLWithString:userImg] placeholderImage:ImageName(@"icon_ellipse")];
|
|
|
_nameLable.text = model.userName;
|
|
|
- _contentLabel.text = model.friendContent;
|
|
|
+// _contentLabel.text = model.friendContent;
|
|
|
+ _contentLabel.attributedText = [self generateAttributedStringWithFriendContent:model.friendContent];
|
|
|
NSArray *friendImgUrls = [model.friendImgUrl componentsSeparatedByString:@","];
|
|
|
_picContainerView.cellModel = _model;
|
|
|
_picContainerView.picPathStringsArray = friendImgUrls;
|
|
@@ -285,6 +286,16 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
_commentView.indexPath = self.indexPath;
|
|
|
}
|
|
|
|
|
|
+- (NSMutableAttributedString *)generateAttributedStringWithFriendContent:(NSString *)friendContent
|
|
|
+{
|
|
|
+ NSString *text = friendContent;
|
|
|
+ NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:text];
|
|
|
+ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
|
+ paragraphStyle.lineSpacing = 4.0f;
|
|
|
+ [attString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, text.length)];
|
|
|
+ return attString;
|
|
|
+}
|
|
|
+
|
|
|
- (void)setFrame:(CGRect)frame
|
|
|
{
|
|
|
[super setFrame:frame];
|