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 |
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.
- 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.
- 7 properties
- property margins as NSEdgeInsetsMBS
- property maximumItemSize as NSSizeMBS
- property maximumNumberOfColumns as Integer
- property maximumNumberOfRows as Integer
- property minimumInteritemSpacing as Double
- property minimumItemSize as NSSizeMBS
- property minimumLineSpacing as Double
- 3 methods
- method backgroundColors as NSColorMBS()
- method Constructor
- method setBackgroundColors(Colors() as NSColorMBS = nil)
- 4 constants
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
- property collectionView as NSCollectionViewMBS
- 3 methods
- method Constructor
- method invalidateLayout
- method invalidateLayoutWithContext(context as NSCollectionViewLayoutInvalidationContextMBS)
- 2 shared methods
- shared method NewInvalidationContext as NSCollectionViewLayoutInvalidationContextMBS
- shared method NewLayoutAttributes as NSCollectionViewLayoutAttributesMBS
This class has no sub classes.
The items on this page are in the following plugins: MBS MacControls Plugin.
NSCollectionViewFlowLayoutMBS - NSCollectionViewItemMBS