Wrapping Text in a UITextView Around a UIImage WITHOUT CoreText

前端 未结 3 2017
旧时难觅i
旧时难觅i 2020-11-29 23:15

Is there a way to wrap text from a UITextView around a UIImage without using CoreText?

I have been playing around with attrib

3条回答
  •  孤独总比滥情好
    2020-11-29 23:48

    This seems to do the trick:

    UIBezierPath * imgRect = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 100, 100)];
    self.textView.textContainer.exclusionPaths = @[imgRect];
    

    Works only from iOS 7 and up.

提交回复
热议问题