• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Layout NSTextAttachment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Layout NSTextAttachment


  • Subject: Re: Layout NSTextAttachment
  • From: Martin Wierschin <email@hidden>
  • Date: Mon, 6 Jul 2009 15:29:54 -0700

I want to layout an NSTextAttachment (an image) to the right margin inside a
text paragraph such that text would flow around the image. I have managed to
coordinate the text container to correctly adjust the proposed rows, and to
make my layout manager to draw the attached image to the correct place in
the text container.


My problem is that the text row, where the attachment is, becomes as high as
the attachment, and I don't seem to find an easy way around it.

You might try setting your attachment's cell to a custom subclass that rigs the height of the attachment. Override "cellFrameForTextContainer:etc:" and others to return some small/ bogus height.


My question is: what is the right way to draw an attachment, and to let text flow around it?

There's not really any "right" way to do this. As far as the Cocoa text layout system is concerned, attachments are always inline / character graphics.


~Martin

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Layout NSTextAttachment (From: Dado Colussi <email@hidden>)

  • Prev by Date: Re: NSApplication and UIApplication
  • Next by Date: Re: NSApplication and UIApplication
  • Previous by thread: Layout NSTextAttachment
  • Next by thread: Re: Layout NSTextAttachment
  • Index(es):
    • Date
    • Thread