• 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: "Vitaly Ovchinnikov" <email@hidden>
  • Date: Mon, 28 Jul 2008 10:23:07 +0400

Thanks, exactly what I need.
Btw, is there any easy way to center this line vertically? Or I need
to measure it's height and offset it vertically myself?

On Mon, Jul 28, 2008 at 9:57 AM, chaitanya pandit
<email@hidden> wrote:
> 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
>
_______________________________________________

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: Uli Kusterer <email@hidden>
    • Re: draw string with ellipsis
      • From: chaitanya pandit <email@hidden>
References: 
 >draw string with ellipsis (From: "Vitaly Ovchinnikov" <email@hidden>)
 >Re: draw string with ellipsis (From: chaitanya pandit <email@hidden>)

  • Prev by Date: [Moderator] iPhone SDK still in effect
  • Next by Date: Re: Need help with predicate format
  • Previous by thread: Re: draw string with ellipsis
  • Next by thread: Re: draw string with ellipsis
  • Index(es):
    • Date
    • Thread