【发布时间】:2013-09-23 21:02:15
【问题描述】:
我正在使用新的 Text Kit API 为某些属性文本添加附件:
// create an attachment for each image
NSTextAttachment* ta = [NSTextAttachment new];
ta.image = [UIImage imageNamed:@"imageName"];
// add to the attributed text string
NSAttributedString* rep = [NSAttributedString attributedStringWithAttachment:ta];
[myAttributedTextString appendAttributedString:rep];
这很好用,我可以在输出中看到我的图像。但是,我找不到任何方法来指定图像对齐或在图像周围环绕文本。
有什么想法吗?
注意:文本附件与排除路径不同 - 文本附件是“模型”的一部分,即它是布局管理器执行文本布局的属性文本字符串的一部分。而排除路径是视图的一部分。
【问题讨论】:
标签: ios objective-c uikit ios7 textkit