Re: draw string with ellipsis
Re: draw string with ellipsis
- Subject: Re: draw string with ellipsis
- From: chaitanya pandit <email@hidden>
- Date: Mon, 28 Jul 2008 01:57:51 -0400
Hi,
Heres what u can do,
NSString *stringToDraw; // the string to draw
NSMutableDictionary *attrs = [NSMutableDictionary
dictionaryWithCapacity:2];
NSMutableParagraphStyle *ps = [[[NSMutableParagraphStyle alloc] init]
autorelease];
[ps setLineBreakMode:NSLineBreakByTruncatingTail];
[attrs setObject:ps forKey:NSParagraphStyleAttributeName];
[stringToDraw drawInRect:rect withAttributes:attrs];
-Chaitanya
On 28-Jul-08, at 1:47 AM, Vitaly Ovchinnikov wrote:
Hello,
What should I pass to -drawInRect's attributes to draw NSString as a
single line with ellipsis at the end if it doesn't fit to the rect?
Or point me to another method that can do that.
Thank you.
_______________________________________________
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
_______________________________________________
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