Domanda

Is it possible to animate a NSTextAttachment in a UITextView?

I tried modifying its bounds but it doesn't seem to produce any effect.

NSAttributedString *attributedText = self.textView.attributedText;
NSTextAttachment *textAttachment = [attributedText attribute:NSAttachmentAttributeName atIndex:index effectiveRange:nil];
textAttachment.bounds = CGRectMake(0, 0, 1, 1);
[UIView animateWithDuration:1 animations:^{
    textAttachment.bounds = CGRectMake(50, 50, 200, 200);
}];

Is this is not possible with NSTextAttachment, what would you suggest doing to achieve a similar effect?

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top