首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何使用iOS7 text Kit将文本环绕在附件周围?

如何使用iOS7 text Kit将文本环绕在附件周围?
EN

Stack Overflow用户
提问于 2013-09-24 05:02:15
回答 3查看 8.1K关注 0票数 18

我正在使用新的Text Kit API向一些属性文本添加附件:

代码语言:javascript
复制
// 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];

这工作得很好,我可以在输出中看到渲染的图像。但是,我找不到任何方法来指定图像对齐方式,或者在图像周围换行。

有什么想法吗?

注意:文本附件不同于排除路径-文本附件是“模型”的一部分,即它是布局管理器对其执行文本布局的属性文本字符串的一部分。而排除路径是视图的一部分。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18968820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档