共用方式為


UICollectionViewLayoutAttributes.CreateForCell 方法

定義

多載

CreateForCell(NSIndexPath)

為位於指定 index.| 的儲存格建立 UICollectionViewLayoutAttributes建立 UICollectionViewLayon

CreateForCell<T>(NSIndexPath)

為位於指定索引路徑的儲存格建立指定類型的版面配置屬性物件。

CreateForCell(NSIndexPath)

為位於指定 index.| 的儲存格建立 UICollectionViewLayoutAttributes建立 UICollectionViewLayon

[Foundation.Export("layoutAttributesForCellWithIndexPath:")]
public static UIKit.UICollectionViewLayoutAttributes CreateForCell (Foundation.NSIndexPath indexPath);
static member CreateForCell : Foundation.NSIndexPath -> UIKit.UICollectionViewLayoutAttributes

參數

indexPath
NSIndexPath

描述要為其建立版面配置屬性物件的儲存格的索引路徑。

傳回

layout 屬性物件,表示位於指定索引路徑的儲存格。

屬性

備註

這個方法一律會傳回 UICollectionViewLayoutAttributes。 如果您已將 UICollectionViewLayoutAttributes 子類別化,而且需要傳回子類別的實例,請改用 CreateForCell(NSIndexPath) 。 這個方法相當於呼叫 CreateForCell < UICollectionViewLayoutAttributes > 。

適用於

CreateForCell<T>(NSIndexPath)

為位於指定索引路徑的儲存格建立指定類型的版面配置屬性物件。

public static T CreateForCell<T> (Foundation.NSIndexPath indexPath) where T : UIKit.UICollectionViewLayoutAttributes;

類型參數

T

要傳回的配置屬性物件型別。

參數

indexPath
NSIndexPath

描述要為其建立版面配置屬性物件的儲存格的索引路徑。

傳回

T

layout 屬性物件,表示位於指定索引路徑的儲存格。

備註

使用此方法可建立 UICollectionViewLayoutAttributes 子類別的配置屬性物件。

適用於