UITableView.RegisterClassForHeaderFooterViewReuse Method

Definition

Overloads

RegisterClassForHeaderFooterViewReuse(Type, NSString)

Registers a type to provide UIViews for headers or footers for a specific reuseIdentifier.

RegisterClassForHeaderFooterViewReuse(Type, String)

Registers the cellType type for reuse, keyed by the identifier reuseIdentifier.

RegisterClassForHeaderFooterViewReuse(Type, NSString)

Registers a type to provide UIViews for headers or footers for a specific reuseIdentifier.

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

Parameters

cellType
Type

The type of a UIView to create when the specified reuseIdentifier is passed to DequeueReusableCell.

reuseIdentifier
NSString

The reuse identifier.

Remarks

You can use this method to register the type of a class that should be instantiated if the UITableView needs to create a new header or footer in response to a request in DequeueReusableHeaderFooterView for the specified reuseIdentifier.

Registering types with reuse identifiers helps reduce the amount of code that you have to write in your GetFooterView or GetHeaderView methods. It means that your code only needs to call DequeueReusableHeaderFooterView with the reuse identifier, and if there is no available cell, the UITableView will create an instance of the specified type and return it.

The type that you register must provide a constructor that takes an IntPtr constructor and needs to chain to the C:UIKit.UIView(IntPtr) constructor.

Applies to

RegisterClassForHeaderFooterViewReuse(Type, String)

Registers the cellType type for reuse, keyed by the identifier reuseIdentifier.

public void RegisterClassForHeaderFooterViewReuse (Type cellType, string reuseIdentifier);
member this.RegisterClassForHeaderFooterViewReuse : Type * string -> unit

Parameters

cellType
Type
reuseIdentifier
String

Applies to