-1
我有一個UITextView
,它會混合使用圖像(如NSTextAttachment
)和字符串。該UITextView
是不可選的,所以我可以使用:從UITextView中刪除/刪除NSTextAttachment
- (BOOL)textView:(UITextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange
如何刪除方法textAttachment
?
'NSMutableAttributedString * mutableAttr = [[TextView的attributedText] mutableCopy]; [mutableAttr replaceCharactersInRange:range withString:@「」]; [textView setAttributedText:mutableAttr];'? – Larme
真棒!發佈這個解決方案,我會接受它 – Gukki5