Type Method

frameSize(forContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:)

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

Declaration

class func frameSize(forContentSize cSize: NSSize, horizontalScrollerClass: AnyClass?, verticalScrollerClass: AnyClass?, borderType type: NSBorderType, controlSize: NSControl.ControlSize, scrollerStyle: NSScroller.Style) -> NSSize

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 NSControl.ControlSize. NSMiniControlSize is not supported.

scrollerStyle

Specifies the scroll style. See NSScroller.Style 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