NSParagraphStyle:alignment
Home 目次>ApplicationKit>NSParagraphStyle このサイトはこちらに移転しました。

alignment

レシーバーのテキスト配置を返します


-(NSTextAlignment) alignment


【返り値】
   NSTextAlignmentテキスト配置


【解説】

レシーバーのテキスト配置を返します。
【NSTextAlignment】
● NSLeftTextAlignment 左揃え
● NSRightTextAlignment 右揃え
● NSCenterTextAlignment センター揃え
● NSJustifiedTextAlignment ジャスティファイ
● NSNaturalTextAlignment 自動(初期設定)
NSNaturalTextAlignmentは文字の言語の自然な配置として、他の配置のうちの1つを使って表示されます。



【例文】


#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{

NSTextTab *tabStop = [[NSTextTab alloc] initWithType:NSLeftTabStopType
location:144];
NSMutableParagraphStyle *pStyle = [NSMutableParagraphStyle defaultParagraphStyle];

[myOutlet setUsesRuler:YES];
[myOutlet setRulerVisible:YES];

switch ([pStyle alignment]){
case NSLeftTextAlignment:
NSLog(@"");
break;
case NSRightTextAlignment:
NSLog(@"NSRightTextAlignment");
break;
case NSCenterTextAlignment:
NSLog(@"NSCenterTextAlignment");
break;
case NSJustifiedTextAlignment:
NSLog(@"NSJustifiedTextAlignment");
break;
case NSNaturalTextAlignment:
NSLog(@"NSNaturalTextAlignment");
break;
default :
break;
}
}

@end


(C) 2000-2009 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSParagraphStyle
修正日2006.12.26