NSMutableAttributedString *str=[[NSMutableAttributedString alloc] initWithString:@"spa
2015年互聯網發生的大事件的影響因素?2015年互聯網發生的大事件的影響因素??code
" attributes:nil];
orm
NSTextAttachment *attachment=[[NSTextAttachment alloc] initWithData:nil ofType:nil];事件
UIImage *img=[UIImage imageNamed:@"qrcode.png"];it
attachment.image=img;table
attachment.bounds=CGRectMake(0, -10, 20, 20);互聯網
NSAttributedString *text=[NSAttributedString attributedStringWithAttachment:attachment];im
//設置從第幾個字符開始插入margin
[str insertAttributedString:text atIndex:0];top
self.textView.attributedText=str;