【发布时间】:2019-02-27 00:09:12
【问题描述】:
我正在开发一个允许用户添加图像并在 UITextView 中移动它的应用程序。文本使用exclusionPaths 在图像周围流动,但是如果该行的其余部分没有足够的空间而不是移动到下一行,则单词会中断。
这是我用来添加图像并为文本容器创建排除路径的方法
textView.addSubview(imageview)
let imagePath = UIBezierPath(rect: imageview.frame)
textView.textContainer.exclusionPaths = imagePath
This is what is happening, notice how the words will break up to the right of the image
感谢您对此的任何帮助!
【问题讨论】:
标签: ios swift uitextview line-breaks exclusionpath