Re: drawing centered text in a box
Re: drawing centered text in a box
- Subject: Re: drawing centered text in a box
- From: "James W. Walker" <email@hidden>
- Date: Sat, 11 Oct 2008 14:33:02 -0700
On Oct 11, 2008, at 10:00 AM, Ricky Sharp wrote:
On Oct 11, 2008, at 11:27 AM, James W. Walker wrote:
When using the NSString or NSAttributedString methods for drawing
text in a box, such as -[NSAttributedString drawWithRect:options:],
is there any way to make the lines of text horizontally centered?
Yes. Create a dictionary with a key of
NSParagraphStyleAttributeName and a value of a NSParagraphStyle
instance with your alignment and potentially other attributes. When
creating an instance of NSAttributedString you can use that
dictionary for its attributes.
Or, use the dictionary with NSString's drawInRect:withAttributes: or
drawWithRect:options:attributes:
Thanks!
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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