Edit

Share via


UICollectionView.SetCollectionViewLayout Method

Definition

Overloads

SetCollectionViewLayout(UICollectionViewLayout, Boolean)

Changes the UICollectionViewLayout used by the UICollectionView.

SetCollectionViewLayout(UICollectionViewLayout, Boolean, UICompletionHandler)

Sets the layout used by this UICollectionView.

SetCollectionViewLayout(UICollectionViewLayout, Boolean)

Changes the UICollectionViewLayout used by the UICollectionView.

[Foundation.Export("setCollectionViewLayout:animated:")]
public virtual void SetCollectionViewLayout (UIKit.UICollectionViewLayout layout, bool animated);
abstract member SetCollectionViewLayout : UIKit.UICollectionViewLayout * bool -> unit
override this.SetCollectionViewLayout : UIKit.UICollectionViewLayout * bool -> unit

Parameters

animated
Boolean

true if the transition to the new layout should be animated.

Attributes

Remarks

A UICollectionView must have its CollectionViewLayout assigned before being displayed. The application developer must either instantiate the UICollectionView with the C:UIKit.UICollectionView.UICollectionView(System.Drawing.RectangleF, UIKit.UICollectionViewLayout) constructor or call this method prior to displaying the UICollectionView.

Applies to

SetCollectionViewLayout(UICollectionViewLayout, Boolean, UICompletionHandler)

Sets the layout used by this UICollectionView.

[Foundation.Export("setCollectionViewLayout:animated:completion:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual void SetCollectionViewLayout (UIKit.UICollectionViewLayout layout, bool animated, UIKit.UICompletionHandler completion);
abstract member SetCollectionViewLayout : UIKit.UICollectionViewLayout * bool * UIKit.UICompletionHandler -> unit
override this.SetCollectionViewLayout : UIKit.UICollectionViewLayout * bool * UIKit.UICompletionHandler -> unit

Parameters

animated
Boolean

true if the transition to the new layout should be animated.

completion
UICompletionHandler

A completion handler action to execute after all other operations are finished.

Attributes

Applies to