【发布时间】:2016-06-21 18:20:18
【问题描述】:
我有一个UITextView,它将混合图像(如NSTextAttachment)和字符串。 UITextView 是不可选择的,所以我可以使用:
- (BOOL)textView:(UITextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange
如何删除方法中的textAttachment?
【问题讨论】:
-
NSMutableAttributedString *mutableAttr = [[textView attributedText] mutableCopy]; [mutableAttr replaceCharactersInRange:range withString:@""]; [textView setAttributedText:mutableAttr];? -
太棒了!将此作为解决方案发布,我会接受它
标签: ios uitextview nstextattachment