-->

包装在一个UITextView文字环绕一个UIImage无CoreText(Wrapping Tex

2019-06-18 20:11发布

有没有办法来包装从文本UITextView周围UIImage不使用CoreText

我一直归因串打周围没有多少运气,和CoreText只是似乎非常复杂,所以我宁愿置身事外。

Answer 1:

这似乎这样的伎俩:

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

只有从iOS 7及以上的作品。



Answer 2:

简单的答案是,你不能没有CoreText前的iOS 7。

我一直是这样我自己前一阵子挣扎和非常有益的给我。 http://robnapier.net/blog/wrapping-text-around-shape-with-coretext-540这是CoreText虽然。



文章来源: Wrapping Text in a UITextView Around a UIImage WITHOUT CoreText