gpt4 book ai didi

iPhone:UITextView 环绕 UIImage?

转载 作者:行者123 更新时间:2023-12-03 18:42:32 27 4
gpt4 key购买 nike

如何让 UITextView 将其文本包裹在 UIImage 周围,如下图所示? alt text

图像大小不一定是事先已知的。

最佳答案

IOS 7 及以上版本:

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

swift (归功于巴特·范·库克):

let exclusionPath = UIBezierPath(rect: CGRectMake(0, 0, 100, 100))
self.textView.textContainer.exclusionPaths = [exclusionPath]

关于iPhone:UITextView 环绕 UIImage?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4380652/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com