I use UILabel to display my text in multi-line mode and in UILineBreakModeWordWrap mode, and the maximum width is 200.
For example, here is the text:
I really really want to underline first word and second word, could you help me?
And I want to emphasize the "first word" and "second word".
If the text is shown in single-line mode, with the sizeWithFont method for NSString, I can easily calculate the position of the "first word" and then override - (void) drawTextInRect: (CGRect) rect to draw a line.
But in multi-line mode, I do not know how to get a position. Do you have any ideas?
source
share