Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSCollectionViewMBS class.

NSCollectionViewMBS.allowsEmptySelection as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value indicating whether the collection view may have no selected items.

The default value of this property is true, which allows the collection view to have no selected items. Setting this property to false causes the collection view to always leave at least one item selected.
(Read and Write property)

NSCollectionViewMBS.allowsMultipleSelection as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the user may select more than one item in the collection view.

The value of this property is true if the collection view supports the selection of more than one item at a time. The default value of this property is false. Changing the value from true to false reduces the current selection to the first item in the selected group.
(Read and Write property)

NSCollectionViewMBS.animator as NSCollectionViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The animator proxy object.
Example
dim collectionView as NSCollectionViewMBS // your control

Dim context As NSAnimationContextMBS = NSAnimationContextMBS.currentContext
context.beginGrouping
context.allowsImplicitAnimation = True
context.duration = 0.5

Dim view As Variant = collectionView.animator
Dim animator As NSCollectionViewMBS = view

// scroll to top
Dim itemPaths() As NSIndexPathMBS
itemPaths.Append NSIndexPathMBS.indexPathForItem(0)

animator.scrollToItems(itemPaths, NSCollectionViewMBS.NSCollectionViewScrollPositionTop)

context.endGrouping

You can call methods on the animator instead of the direct object. Methods with animation support will then be animated.
(Read only property)

NSCollectionViewMBS.backgroundView as NSViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The background view placed behind all items and supplementary views.

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.
(Read and Write property)

NSCollectionViewMBS.backgroundViewScrollsWithContent as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the collection view’s background view scrolls with the items and other content.

The default value of this property is false, which means that backgroundView (if it exists) fills the collection view's visible area and remains stationary when the collection view's content is scrolled. When the value of this property is YES, backgroundView matches the collection view's frame and scrolls with the collection view's items and other content.
Changing the value of this property also changes the background view’s parent. When backgroundView floats behind the scrolling content, it is a sibling of the collection view’s clip view. When it scrolls with the collection view’s content, it is a subview of the collection view.
(Read and Write property)

NSCollectionViewMBS.collectionViewLayout as NSCollectionViewLayoutMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The layout object used to organize the collection view’s content.

Typically, you specify the layout object at design time in Interface Builder. The layout object works with your data source object to generate the needed items and views to display. In macOS 10.11 and later, using a data source object is recommended, but you may specify nil for this property if your collection view does not use a data source object. The collection view uses the NSCollectionViewGridLayout object by default.

Assigning a new value to this property changes the layout object and causes the collection view to update its contents immediately and without animations.
(Read and Write property)

Some examples using this property:

NSCollectionViewMBS.firstResponder as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value indicating whether the collection view is the first responder.

The value of this property is true when the collection view is the first responder. This property is fully key-value observing compliant.
(Read only property)

NSCollectionViewMBS.numberOfSections as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The number of sections in the collection view.

This property contains the number of sections reported by the data source object. If the collection view does not use a data source object, the value in this property is 1.
(Read only property)

NSCollectionViewMBS.selectable as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the user may select items in the collection view.

The value of this property is true when the collection view allows the user to select items, or false when it does not. You can set selections programmatically regardless of this setting.

The default value of this property is false. Changing the value from YES to NO removes the current selection if there is one.
(Read and Write property)

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


The biggest plugin in space...