Instance Property

backgroundView

The background view placed behind all items and supplementary views.

Declaration

@property(strong) NSView *backgroundView;

Discussion

The view you assign to this property is positioned underneath all other content and sized automatically to match the enclosing clip view’s frame. The view itself does not scroll with the rest of the collection view content. The view’s layer redraw policy is also changed to NSViewLayerContentsRedrawNever.

In macOS 10.12 and later, a collection view that sets both backgroundView and backgroundColors shows backgroundColors[0] through all areas that are not opaquely covered by the backgroundView.

See Also

Configuring the Collection View

delegate

The collection view’s delegate object.

NSCollectionViewDelegate

A set of methods that you use to manage the behavior of a collection view.

content

An array that provides data for the collection view.

backgroundColors

An array containing the collection view’s background colors.

backgroundViewScrollsWithContent

A Boolean value that indicates whether the collection view’s background view scrolls with the items and other content.