UIImage *image = [UIImage imageNamed:@
"321.jpg"
];
// 1> 生成文本附件
NSTextAttachment
*textAttach = [[
NSTextAttachment
alloc] init];
textAttach.image = image;
// 2> 使用文本附件创建属性文本
NSAttributedString
*strA = [
NSAttributedString
attributedStringWithAttachment:textAttach];
self
.lblChat.attributedText = strA;