Truncating a string with ellipses in a multi-line drawInRect: operation?
Truncating a string with ellipses in a multi-line drawInRect: operation?
- Subject: Truncating a string with ellipses in a multi-line drawInRect: operation?
- From: Keith Blount <email@hidden>
- Date: Sun, 19 Feb 2006 10:25:28 -0800 (PST)
Hello,
I have a view that draws lots of rectangles of text to
look like index cards. To draw the main block of text
for each card, I'm using NSString's
-drawInRect:withAttributes:. However, I would like to
make it so that if the text is too long to fit into
the index card, the last visible line is truncated to
display an ellipsis at its end.
Obviously this is very easy to do when drawing only a
single line, as you can just set
NSLineBreakByTruncatingTail for the line break mode of
the paragraph style. The problem is that I want my
text to wrap to fill the rectangle, and then only have
the last line truncated with an ellipsis - setting the
line break mode confines the whole text to one line.
Does anybody have any ideas of how I would go about
this?
Many thanks in advance for any suggestions,
Keith
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden