Platforms to show: All Mac Windows Linux Cross-Platform

NSCollectionViewGridLayoutMBS class

Super class: NSCollectionViewLayoutMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A layout that displays a single section of items in a row and column grid..

The NSCollectionViewGridLayoutMBS object provides the same layout behavior offered by the NSCollectionViewMBS class prior to macOS 10.11, and you can use it in cases where you want to maintain the old appearance while still taking advantage of newer collection view features.

Configuring a Collection View to Use a Grid Layout

You can configure a collection view to use a grid layout object programmatically or at design time:

  • At design time, set the Layout attribute of your collection view to Grid.
Create an NSCollectionViewGridLayoutMBS object programmatically and assign it to the collection view’s collectionViewLayout property.
  • A grid layout displays only items and does not display supplementary views or decoration views. Use the properties of this class to configure the number of rows and columns in the grid. You can also use these properties to configure the spacing between items and the minimum sizes.
Subclass of the NSCollectionViewLayoutMBS class.

Highlight States

Constant Value Description
HighlightAsDropTarget 3 The drop target highlight state. This type of highlight is applied when the item is the target of a drop operation on the collection view. After the drop operation completes, the highlight state returns to HighlightNone.
HighlightForDeselection 2 The deselection highlight state. During interactive selection, this state is used to indicate that the item will become deselected when interactions end. After interactions end, the highlight state returns to HighlightNone.
HighlightForSelection 1 The selected highlight state. This type of highlight is applied when an item is selected. During interactive highlighting, this state is also applied to indicate that the item will become highlighted.
HighlightNone 0 No highlight state.

Super class NSCollectionViewLayoutMBS

This class has no sub classes.


The items on this page are in the following plugins: MBS MacControls Plugin.


NSCollectionViewFlowLayoutMBS   -   NSCollectionViewItemMBS


The biggest plugin in space...