macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setAttachmentSize:forGlyphRange:

テキストアタッチメントのサイズをセットします
-(void)setAttachmentSize:(NSSize)attachmentSize:
         forGlyphRange:(NSRange)glyphRange:

解説

テキストアタッチメントのサイズをセットします。

返り値

( void )

なし

引数

( NSSize )attachmentSize

アタッチメントのサイズ

( NSRange )glyphRange

グリフの範囲

フレームワーク

ApplicationKit

クラス

NSLayoutManager

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
	//myOutletはTextView
	NSLayoutManager *layM1;
	NSSize size;
	layM1 = [myOutlet1 layoutManager];

	size = [layM1 attachmentSizeForGlyphAtIndex:3];
	NSLog([NSString stringWithFormat:@"%.1f,%.1f",size.width,size.height]);

	[layM1 setAttachmentSize:NSMakeSize(30,30) forGlyphRange:NSMakeRange(1,3)];

	size = [layM1 attachmentSizeForGlyphAtIndex:3];
	NSLog(@"%.1f,%.1f",size.width,size.height);
}
@end