UICollectionView.SetCollectionViewLayout 方法

定义

重载

SetCollectionViewLayout(UICollectionViewLayout, Boolean)

UICollectionViewLayout更改 使用的 UICollectionView

SetCollectionViewLayout(UICollectionViewLayout, Boolean, UICompletionHandler)

设置此 UICollectionView使用的布局。

SetCollectionViewLayout(UICollectionViewLayout, Boolean)

[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

参数

animated
Boolean

true 如果要对过渡到新布局进行动画处理,则为 。

属性

注解

UICollectionView 显示之前,必须分配其 CollectionViewLayout 。 应用程序开发人员必须使用 UICollectionViewC:UIKit.UICollectionView.UICollectionView (System.Drawing.RectangleF、UIKit.UICollectionViewLayout) 构造函数实例化 ,或者在显示 UICollectionView之前调用此方法。

适用于

SetCollectionViewLayout(UICollectionViewLayout, Boolean, UICompletionHandler)

设置此 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

参数

animated
Boolean

true 如果要对过渡到新布局进行动画处理,则为 。

completion
UICompletionHandler

完成所有其他操作后执行的完成处理程序操作。

属性

适用于