Re: Get text width outside a view
Re: Get text width outside a view
- Subject: Re: Get text width outside a view
- From: "Christian Giordano" <email@hidden>
- Date: Wed, 22 Oct 2008 22:20:56 +0100
Probably my method was working but sizeWithFont is definitely the one
to be used.
Thanks a lot!
chr
On Wed, Oct 22, 2008 at 7:27 PM, Marco Masser <email@hidden> wrote:
>> I'm trying to calculate the width of a text
>
> Cocoa: NSAttributedString(AppKitAdditions) implements a method named -size
> which gives you the size as if the string was drawn with the attributes set.
>
> Cocoa Touch: NSString(UIStringDrawing) has some methods starting with
> -sizeWithFont... which do just what you want.
>
> Marco
> _______________________________________________
>
> 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