Platforms to show: All Mac Windows Linux Cross-Platform
NSCollectionViewLayoutAttributesMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Collection View | MBS MacControls Plugin | 21.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
During the layout, the layout object creates instances of NSCollectionViewLayoutAttributesMBS for each element displayed in the collection view. The layout attributes describe the position of an element and other information such as its alpha and position on the z axis. The collection view later applies the layout attributes to the onscreen elements.
The only time you interact with layout attribute objects is when you implement a custom layout, and the interactions are straightforward. When asked for layout attributes for a specific element, your layout object uses the methods of this class to create an appropriate instance of the class based on the type of the requested element. It then configures the properties of the object and returns it to the requester.
- 8 properties
- property alpha as Double
- property frame as NSSizeMBS
- property Hidden as Boolean
- property indexPath as NSIndexPathMBS
- property representedElementCategory as Integer
- property representedElementKind as String
- property size as NSSizeMBS
- property zIndex as Integer
- 2 methods
- method Constructor
- method copy as NSCollectionViewLayoutAttributesMBS
- 5 shared methods
- shared method ElementKindInterItemGapIndicator as String
- shared method layoutAttributesForDecorationView(decorationViewKind as String, indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
- shared method layoutAttributesForInterItemGapBefore(indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
- shared method layoutAttributesForItem(indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
- shared method layoutAttributesForSupplementaryView(elementKind as String, indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
- 4 constants
Element Categories
Constant | Value | Description |
---|---|---|
ElementCategoryDecorationView | 2 |
The element is a decoration view. Decoration views represent visual adornments that do not contain any data of their own. |
ElementCategoryInterItemGap | 3 |
The element is an inter-item gap. An inter-item gap element is a custom visual indicator that is displayed between items when dropping items into the collection view. |
ElementCategoryItem | 0 |
The element is an item. Items represent the main content of your collection view. |
ElementCategorySupplementaryView | 1 |
The element is a supplementary view. Use supplementary views for single views that contain some data but are associated with an entire section. For example, use them to specify header or footer views for a section. |
This class has no sub classes.
Some methods using this class:
- NSCollectionViewLayoutMBS.NewLayoutAttributes as NSCollectionViewLayoutAttributesMBS
- NSCollectionViewMBS.layoutAttributesForItem(indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
- NSCollectionViewMBS.layoutAttributesForSupplementaryElementOfKind(kind as String, indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
Some events using this class:
- DesktopNSCollectionViewControlMBS.ItemApplyLayoutAttributes(item as NSCollectionViewItemMBS, layoutAttributes as NSCollectionViewLayoutAttributesMBS)
- DesktopNSCollectionViewControlMBS.ItemPreferredLayoutAttributesFittingAttributes(item as NSCollectionViewItemMBS, layoutAttributes as NSCollectionViewLayoutAttributesMBS) as NSCollectionViewLayoutAttributesMBS
- NSCollectionViewControlMBS.ItemApplyLayoutAttributes(item as NSCollectionViewItemMBS, layoutAttributes as NSCollectionViewLayoutAttributesMBS)
- NSCollectionViewControlMBS.ItemPreferredLayoutAttributesFittingAttributes(item as NSCollectionViewItemMBS, layoutAttributes as NSCollectionViewLayoutAttributesMBS) as NSCollectionViewLayoutAttributesMBS
The items on this page are in the following plugins: MBS MacControls Plugin.
NSCollectionViewItemMBS - NSCollectionViewLayoutInvalidationContextMBS