| Home 目次>ApplicationKit>NSMutableParagraphStyle | |
setAlignment:
テキスト配置をセットします
-(void) setAlignment:(NSTextAlignment)alignment
【返り値】 | |
| void | なし |
| 【パラメータ】 | |
| alignment | テキスト配置 |
【解説】
テキスト配置をセットします。
【NSTextAlignment】
● NSLeftTextAlignment
● NSRightTextAlignment
● NSCenterTextAlignment
● NSJustifiedTextAlignment
● NSNaturalTextAlignment
【例文】
#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
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSMutableParagraphStyle | 修正日2006.12.26 |