UICollectionView.RegisterClassForSupplementaryView Method

Definition

Overloads

RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, NSString)

Specifies the type to be used to populate supplementary views.

RegisterClassForSupplementaryView(Type, NSString, String)

Specifies the type to be used to populate supplementary views.

RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, String)

Specifies the type to be used to populate supplementary views.

RegisterClassForSupplementaryView(IntPtr, NSString, NSString)

Specifies the type to be used to populate supplementary views.

RegisterClassForSupplementaryView(Type, NSString, NSString)

Specifies the type to be used to populate supplementary views.

RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, NSString)

Specifies the type to be used to populate supplementary views.

public void RegisterClassForSupplementaryView (Type cellType, UIKit.UICollectionElementKindSection section, Foundation.NSString reuseIdentifier);
member this.RegisterClassForSupplementaryView : Type * UIKit.UICollectionElementKindSection * Foundation.NSString -> unit

Parameters

cellType
Type

A subtype of UICollectionReusableView to be used for supplementary views

section
UICollectionElementKindSection

The type of supplementary view being registered.

reuseIdentifier
NSString

A non-empty string to be associated with the cellType.

Remarks

The UICollectionView maintains a highly-efficient reuse queue for offscreen components. This requires that the UICollectionView be responsible for the lifecycle management of its component views. This method (and related methods such as RegisterClassForCell(Type, String)) provide the UICollectionView the knowledge of which types it needs to instantiate.

The application developer may pass null as the reuseIdentifier, in which case the cellType will be "un-registered" and no longer instantiated. The application developer may pass in a reuseIdentifier previously associated with another type, in which case the old type will be "de-registered" and the new cellType will be used.

It is very important that you provide constructor that takes an IntPtr argument in any subclasses that you register. This is required because the classes are actually allocated by the Objective-C runtime, and you must initialize them.

See also

  • <xref:UIKit.UICollectionView.RegisterClassForCell>
  • <xref:UIKit.UICollectionView.RegisterNibForCell>
  • <xref:UIKit.UICollectionView.RegisterNibForSupplementaryView>
  • <xref:UIKit.UICollectionViewLayout.RegisterClassForDecorationView>
  • <xref:UIKit.UICollectionViewLayout.RegisterNibForDecorationView>

Applies to

RegisterClassForSupplementaryView(Type, NSString, String)

Specifies the type to be used to populate supplementary views.

public void RegisterClassForSupplementaryView (Type cellType, Foundation.NSString kind, string reuseIdentifier);
member this.RegisterClassForSupplementaryView : Type * Foundation.NSString * string -> unit

Parameters

cellType
Type
kind
NSString
reuseIdentifier
String

Applies to

RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, String)

Specifies the type to be used to populate supplementary views.

public void RegisterClassForSupplementaryView (Type cellType, UIKit.UICollectionElementKindSection section, string reuseIdentifier);
member this.RegisterClassForSupplementaryView : Type * UIKit.UICollectionElementKindSection * string -> unit

Parameters

cellType
Type
reuseIdentifier
String

Applies to

RegisterClassForSupplementaryView(IntPtr, NSString, NSString)

Specifies the type to be used to populate supplementary views.

[Foundation.Export("registerClass:forSupplementaryViewOfKind:withReuseIdentifier:")]
protected virtual void RegisterClassForSupplementaryView (IntPtr viewClass, Foundation.NSString kind, Foundation.NSString reuseIdentifier);
abstract member RegisterClassForSupplementaryView : nativeint * Foundation.NSString * Foundation.NSString -> unit
override this.RegisterClassForSupplementaryView : nativeint * Foundation.NSString * Foundation.NSString -> unit

Parameters

viewClass
IntPtr

nativeint

An IntPtr to the type to be used for supplementary views.

kind
NSString

The type of supplementary view being registered (e.g., "UICollectionElementKindSectionHeader").

reuseIdentifier
NSString

A non-empty string to be associated with the kind.

Attributes

Remarks

The UICollectionView maintains a highly-efficient reuse queue for offscreen components. This requires that the UICollectionView be responsible for the lifecycle management of its component views. This method (and related methods such as RegisterClassForCell(Type, String)) provide the UICollectionView the knowledge of which types it needs to instantiate.

The application developer may pass null as the reuseIdentifier, in which case the viewClass will be "un-registered" and no longer instantiated. The application developer may pass in a reuseIdentifier previously associated with another type, in which case the old type will be "de-registered" and the new viewClass will be used.

It is very important that you provide constructor that takes an IntPtr argument in any subclasses that you register. This is required because the classes are actually allocated by the Objective-C runtime, and you must initialize them.

See also

  • <xref:UIKit.UICollectionView.RegisterClassForCell>
  • <xref:UIKit.UICollectionView.RegisterNibForCell>
  • <xref:UIKit.UICollectionView.RegisterNibForSupplementaryView>
  • <xref:UIKit.UICollectionViewLayout.RegisterClassForDecorationView>
  • <xref:UIKit.UICollectionViewLayout.RegisterNibForDecorationView>

Applies to

RegisterClassForSupplementaryView(Type, NSString, NSString)

Specifies the type to be used to populate supplementary views.

public void RegisterClassForSupplementaryView (Type cellType, Foundation.NSString kind, Foundation.NSString reuseIdentifier);
member this.RegisterClassForSupplementaryView : Type * Foundation.NSString * Foundation.NSString -> unit

Parameters

cellType
Type

A subtype of UICollectionReusableView to be used for supplementary views.

kind
NSString

The type of supplementary view being registered (e.g., "UICollectionElementKindSectionHeader").

reuseIdentifier
NSString

A non-empty string to be associated with the kind.

Applies to