Type Method

frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:

Returns the frame size of a scroll view that contains a content view with the specified size.

Declaration

+ (NSSize)frameSizeForContentSize:(NSSize)cSize horizontalScrollerClass:(Class)horizontalScrollerClass verticalScrollerClass:(Class)verticalScrollerClass borderType:(NSBorderType)type controlSize:(NSControlSize)controlSize scrollerStyle:(NSScrollerStyle)scrollerStyle;

Parameters

contentSize

The content size.

horizontalScrollerClass

The class used as the horizontal scroller. A value of nil specifies that no horizontal scroller is used.

verticalScrollerClass

The class used as the vertical scroller. A value of nil specifies that no horizontal scroller is used.

borderType

Specifies the appearance of the style of the scroll view’s border. See NSBorderType for a list of possible values.

controlSize

The control size. The possible values are specified in NSControlSize. NSMiniControlSize is not supported.

scrollerStyle

Specifies the scroll style. See NSScrollerStyle for supported values.

Return Value

The size of the frame for the specified contentSize.

Discussion

For an existing scroll view, you can simply use the frame method and extract its size.

See Also

Calculating Layout

+ contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:

Returns the content size calculated from the frame size and the specified specifications.