你的位置:首页 > 软件开发 > 操作系统 > TextView表情文字混排

TextView表情文字混排

发布时间:2015-10-27 19:00:09
2015-10-27- (void)layoutSubviews { skContentView.backgroundColor = self.backgroundColor; skContentView.frame = self.bounds; NSMutable ...

2015-10-27

- (void)layoutSubviews {    skContentView.backgroundColor = self.backgroundColor;  skContentView.frame = self.bounds;    NSMutableAttributedString * string = [[ NSMutableAttributedString alloc ] initWithString:@"123456789101112计算" attributes:nil ] ;  [string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16.0] range:NSMakeRange(0,string.length-1)];    MMTextAttachment * textAttachment = [[ MMTextAttachment alloc ] initWithData:nil ofType:nil ] ;  UIImage * smileImage = [ UIImage imageNamed:@"a.jpg" ] ; //my emoticon image named a.jpg  textAttachment.image = smileImage ;    NSAttributedString * textAttachmentString = [ NSAttributedString attributedStringWithAttachment:textAttachment ] ;  [ string insertAttributedString:textAttachmentString atIndex:6 ] ;    _skInputTextView.attributedText = string ;}

原标题:TextView表情文字混排

关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。