I want to add Image on text view and want proper spacing as shown in screenshot.
我尝试在文本视图上添加图像,但在根据要求放置文本时遇到问题。
请向我提供有关同样的帮助。
定义textView和imageView后添加以下代码。
import CoreText.Framework
UIBezierPath *exclusionPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height)];
textView.textContainer.exclusionPaths = @[exclusionPath];
[textView addSubview:imageView];
要对核心文本教程有清晰的了解,请参阅雷文德利希 http://www.raywenderlich.com/50151/text-kit-tutorial
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)