Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSCollectionViewGridLayoutMBS class.

NSCollectionViewGridLayoutMBS.backgroundColors as NSColorMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The array of background colors to use when drawing the grid.

The NSColorMBS objects in this property are used to draw the grid’s background. The appearance of the background depends on the value you specify:

  • Specifying nil fills the background with the collection view’s default background color.
  • Specifying an empty array causes the collection view to draw no background color.
  • Specifying an array with one color object fills the background with the specified color.
  • Specifying an array with more than one color object causes the collection view to use the specified colors to create a checkerboard pattern. Each successive grid item is displayed with the next color in the array, cycling back to the beginning of the array when the last color is reached.

The default value of this property is nil.

NSCollectionViewGridLayoutMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The constructor.

NSCollectionViewGridLayoutMBS.setBackgroundColors(Colors() as NSColorMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the array of background colors to use when drawing the grid.

The NSColorMBS objects in this property are used to draw the grid’s background. The appearance of the background depends on the value you specify:

  • Specifying nil fills the background with the collection view’s default background color.
  • Specifying an empty array causes the collection view to draw no background color.
  • Specifying an array with one color object fills the background with the specified color.
  • Specifying an array with more than one color object causes the collection view to use the specified colors to create a checkerboard pattern. Each successive grid item is displayed with the next color in the array, cycling back to the beginning of the array when the last color is reached.

The default value of this property is nil.

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


The biggest plugin in space...