I am trying to get the following effect using a UITextView:
Basically I want to insert an image between text. The image can simply just take up 1 row of space so there is no wrapping necessary.
I tried just adding a UIView to the subview:
UIView *pictureView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 25, 25)];
[pictureView setBackgroundColor:[UIColor redColor]];
[self.textView addSubview:pictureView];
But it seems to float over the text and cover it.
I did a bit of reading on exclusion paths which appears to be one way of implementing this. However, I don't want to absolutely position the image - instead, it should flow with the text (similar to how <span>
behaves in HTML).
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…