How to draw text that wraps around objects on top and bottom right?

I have a problem similar to this question , but more complex. I am trying to draw text in a cell in a table that has a date stamp from the top right and bottom right icon, for example:

+-----------------------+----+
| Lorem ipsum dolor sit |DATE|
| amet, consectetur     +----+
| adipiscing elit. Integer   |
| ligula lectus, convallis   |
| non scelerisque      +-----+
| quis, tempor at nibh |BADGE|
+----------------------+-----+

I want the cell to be larger or smaller if the text is larger or smaller:

+-----------------------+----+
| Lorem ipsum dolor sit |DATE|
| amet, consectetur     +----+
| adipiscing elit. Integer   |
| ligula lectus, convallis   |
| non scelerisque quis,      |
| tempor at nibh.  Curabitur |
| eget diam ligula.          |
| Pellentesque a elit        |
| dolor, a ullamcorper +-----+
| risus.               |BADGE|
+----------------------+-----+

The answer to the old question is related to a project that shows how to convey text around famous figures. But I do not know the form in advance, since I need an icon to align with the bottom of the text.

Is it possible? If so, how do I draw text and how can I determine how tall it is?

+5
source share
2 answers

, , , . . ColumnView.

:

  • : , . . .
  • CTFrameSetter. CTFrame, . , . , .
  • . , , ( , - , ).
  • .
  • CTFrameSetter . , . , . , .
  • , . . , .
  • .

, , , , .

+3

, , , . , . : https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html

, : http://sheepsystems.com/sourceCode/sourceStringGeometrics.html

, , . , . - :

+-----------------------+----+
| BADGE|                |DATE|
|+-----+      TITLE     +----+
| dolor sit amet, consectetur|     
| adipiscing elit. Integer   |
| ligula lectus, convallis   |
| non scelerisque quis,      |
| tempor at nibh.  Curabitur |
| eget diam ligula.          |
| Pellentesque a elit        |
| dolor, a ullamcorper risus.|
+----------------------------+
+1

All Articles