Re: Centering an NSAttributedString in a line in a view
Re: Centering an NSAttributedString in a line in a view
- Subject: Re: Centering an NSAttributedString in a line in a view
- From: email@hidden
- Date: Wed, 19 Jul 2006 11:14:26 +0200 (CEST)
- Importance: Normal
>Could you please actually *show* your -pageFooter: code?
>
>m.
Of course. I did not put it in my first post to keep it short. Here it
is :
-(NSAttributedString*) pageFooter
{
NSAttributedString* oldFooter;
NSMutableAttributedString* newFooter;
unsigned footerLength;
NSRange range;
NSDictionary* attributes;
NSMutableParagraphStyle* parsty;
oldFooter=[super pageFooter];
footerLength=[oldFooter length];
range.location=0;
range.length=footerLength;
attributes=[oldFooter
attributesAtIndex: 0
longestEffectiveRange: NULL
inRange: range];
parsty=[attributes objectForKey : NSParagraphStyleAttributeName];
[parsty setAlignment: NSCenterTextAlignment];
newFooter=
[[NSMutableAttributedString alloc]
initWithAttributedString: oldFooter];
[newFooter
addAttribute: NSParagraphStyleAttributeName
value: parsty
range: range];
return newFooter;
}
Ewan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden