setAlignment:
テキスト配置をセットします
-(void)setAlignment:(NSTextAlignment)alignment:
解説
テキスト配置をセットします。
【NSTextAlignment】
● NSLeftTextAlignment
● NSRightTextAlignment
● NSCenterTextAlignment
● NSJustifiedTextAlignment
● NSNaturalTextAlignment
返り値
( void )
なし
引数
( NSTextAlignment )alignment
テキスト配置
フレームワーク
ApplicationKit
クラス
NSMutableParagraphStyle
Instance Methods
使用可能
10.0
参照
- alignment (NSParagraphStyle)
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSTextTab *tabStop1 = [[NSTextTab alloc] initWithType:NSLeftTabStopType location:10]; NSTextTab *tabStop2 = [[NSTextTab alloc] initWithType:NSLeftTabStopType location:20]; NSArray *arr = [NSArray arrayWithObjects:tabStop1,tabStop2,nil]; NSMutableParagraphStyle *pStyle1 = [[NSMutableParagraphStyle alloc] init]; [pStyle1 setTabStops:arr]; [pStyle1 setAlignment:NSCenterTextAlignment]; } @end