// modify by huangyibiao
//添加文本信息
TTTAttributedLabel *bubbleText = [[TTTAttributedLabel alloc]
initWithFrame:CGRectMake(fromSelf?10.0f:27.0f, 20.0f, size.width+10, size.height+10)];
bubbleText.delegate = self;
bubbleText.backgroundColor = [UIColor clearColor];
bubbleText.tag=indexPath.row;
bubbleText.font = font;
bubbleText.numberOfLines = 0;
bubbleText.lineBreakMode = NSLineBreakByWordWrapping;
bubbleText.text = text;
bubbleText.linkAttributes = @{(NSString *)kCTUnderlineStyleAttributeName : [NSNumber numberWithBool:YES],
(NSString*)kCTForegroundColorAttributeName : (id)[[UIColor blueColor] CGColor]};
bubbleText.highlightedTextColor = [UIColor whiteColor];
bubbleText.verticalAlignment = TTTAttributedLabelVerticalAlignmentTop;
// end modify by huangyibiao
// add by huangyibiao
处理文本中的超链接
最新推荐文章于 2024-05-09 14:43:28 发布
本文探讨了如何有效地处理文本中的超链接,包括解析、提取和管理这些链接的方法,为文本处理提供实用策略。
摘要由CSDN通过智能技术生成