NSTextAttachment *imageAttachment = [[NSTextAttachment alloc] init];
imageAttachment.image = image;
imageAttachment.bounds = CGRectMake(0, 0, 30, 30);
NSDictionary *imageAttributes = @{NSAttachmentAttributeName:imageAttachment};
NSAttributedString *imageAttStr = [[NSAttributedString alloc] initWithString:@"" attributes:imageAttributes];
网友评论