ios - 如何在 UIImageView 周围环绕文字?

标签 ios objective-c cocoa-touch text word-wrap

我一直在研究这个。我正在尝试在图像周围环绕一些文本。

|| Some || Lets say
||Image || i want
to place the text
around here.

我知道这个问题已经有人问过,但我找不到任何好的答案。 有任何想法吗? (我不介意文本在 UIWebView 中)

最佳答案

UIBezierPath * imgRect = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 100, 100)];

UIImageView *imageView= [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
imageView.image=[UIImage imageNamed:@"defaultImage"];
[self.textView addSubview:imageView];
self.textView.textContainer.exclusionPaths = @[imgRect];

关于ios - 如何在 UIImageView 周围环绕文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8645401/

相关文章:

iphone - EXC_BAD_ACCESS 当 popViewController

iphone - 导航 Controller 后退按钮消失了吗?

iphone - 在后台请求 iPhone 位置?

iphone - 针对 iOS 3 和 iOS 4 启用了 locationServices

ios - 如何在Azure托管代理上使用特定的iOS版本?

android - Webrtc Mobile kurento 客户端

ios - 再次 : Not convertible to UInt8

ios - 随机运动/湍流 - SWIFT

ios - Xcode - 如何检测 iPhone 的屏幕尺寸

ios - 使用 NSLayoutConstraint 的 Superview 中 UIPageControl 的编程垂直对齐