frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:
内容ビューのサイズとスクローラと枠タイプからフレームサイズを返します
+(NSSize)frameSizeForContentSize:(NSSize)contentSize: hasHorizontalScroller:(BOOL)hFlag: hasVerticalScroller:(BOOL)vFlag: borderType:(NSBorderType)borderType:
解説
内容ビューのサイズとスクローラと枠タイプからフレームサイズを返します。
【NSBorderType】
● NSNoBorder 枠無し
● NSLineBorder 線
● NSBezelBorder 立体的な枠
● NSGrooveBorder 溝つき
返り値
( NSSize )
サイズ
引数
( NSSize )contentSize
内容のサイズ
( BOOL )hFlag
水平スクローラを持つか
( BOOL )vFlag
垂直スクローラを持つか
( NSBorderType )borderType
枠タイプ
フレームワーク
ApplicationKit
クラス
NSScrollView
Class Methods
使用可能
10.0
参照
- contentView
- setDocumentView:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSSize size = [NSScrollView frameSizeForContentSize:NSMakeSize(100,100) hasHorizontalScroller:YES hasVerticalScroller:YES borderType:NSBezelBorder ]; NSLog([NSString stringWithFormat:@"%.1f,%.1f",size.width,size.height]); } @end