How to wrap text around attachments using iOS7 Text Kit?

后端 未结 3 1561
自闭症患者
自闭症患者 2021-01-31 20:09

I am using the new Text Kit API to add attachments to some attributed text:

// create an attachment for each image
NSTextAttachment* ta = [NSTextAttachment new];         


        
3条回答
  •  走了就别回头了
    2021-01-31 20:40

    ta.bounds = (CGRect) { 0, yPadding, ta.image.size }; 
    

    change yPadding you need.
    It can be negative when image's height is large than line height.

提交回复
热议问题