Tag: uitextview nstextattachment

在带有属性文本的UITextView中重绘NSTextAttachments

我有一个覆盖NSTextAttachment子类 attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex: imageForBounds:textContainer:characterIndex: 我需要在某个时候重新绘制附件。 在UITextView上调用setNeedsDisplay不起作用。 有任何想法吗? 我想避免重新创build附件和/或属性string。