如何NSTextAttachment
在 中的特定位置插入NSAttributedString
?
问问题
376 次
1 回答
0
let attributedString = NSAttributedString(attachment: textAttachment)
let mutableAttributedText = NSMutableAttributedString(attributedString: textView.attributedText)
mutableAttributedText.replaceCharacters(in: selectedRange, with: attributedString)
textView.attributedText = mutableAttributedText
于 2017-04-13T14:46:00.803 回答