• 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: draw string with ellipsis
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: draw string with ellipsis
      • From: "Vitaly Ovchinnikov" <email@hidden>
References: 
 >draw string with ellipsis (From: "Vitaly Ovchinnikov" <email@hidden>)

  • Prev by Date: [Moderator] - List Guidelines - Must Read
  • Next by Date: [Moderator] iPhone SDK still in effect
  • Previous by thread: draw string with ellipsis
  • Next by thread: Re: draw string with ellipsis
  • Index(es):
    • Date
    • Thread