如图:标题前面添加海外直邮和跨境保税,iOS最好使用富文本添加图片附件的方法
NSTextAttachment*textAttachment = [[NSTextAttachment alloc] init];
//给附件添加图片
textAttachment.image= [UIImage imageNamed:@"trc_mall_overseas_directmail"];
//调整一下图片的位置,如果你的图片偏上或者偏下,调整一下bounds的y值即可
textAttachment.bounds=CGRectMake(0, -4, textAttachment.image.size.width, textAttachment.image.size.height);
//把附件转换成可变字符串,用于替换掉源字符串中的表情文字
NSAttributedString*imageStr = [NSAttributedString attributedStringWithAttachment:textAttachment];
[m_attributedString appendAttributedString:imageStr];