xcode swift 如何在图像周围环绕文本 [英] xcode swift how to wrap text around image

查看:39
本文介绍了xcode swift 如何在图像周围环绕文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 tableview 中的图像周围环绕文本.下面是一个带有图像和文本的 tableview 示例,我希望文本环绕在图像的侧面和下方.

How do I wrap text around an image in a tableview. Below is a sample of a tableview with image and text, I would like to have the text wrap to the side and below the image.

推荐答案

为此使用 UITextView,

Use UITextView for this,

cell.layoutIfNeeded()
let imageFrame = UIBezierPath(rect: cell.imageView.frame)
cell.textView.textContainer.exclusionPaths = [imageFrame]

这篇关于xcode swift 如何在图像周围环绕文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆