iOS Guides | Samples

UIKit.UICollectionViewFlowLayout Class

A flow-based layout for use with UICollectionViews.

See Also: UICollectionViewFlowLayout


[Foundation.Register("UICollectionViewFlowLayout", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public class UICollectionViewFlowLayout : UICollectionViewLayout

See Also


UICollectionViews allow content to be displayed using arbitrary layouts. The UICollectionViewFlowLayout provides an easy-to-use flow-based layout.

The UICollectionViewFlowLayout lays out UICollectionViewCells side-by-side, either horizontally or vertically. Component UICollectionViewCells wrap at the boundaries. Cells are spaced in the direction of layout according to the UICollectionViewFlowLayout.MinimumInteritemSpacing property and rows (whether horizontal or vertical) are separated based on the UICollectionViewFlowLayout.MinimumLineSpacing property.

The application developer can use various methods of UICollectionViewDelegateFlowLayout to modify the exact spacing and size of cells within a UICollectionViewFlowLayout.

The direction of the flow layout is at right angles to the direction of the UICollectionViewFlowLayout.ScrollDirection property. In the following image, the flow layout is left-to-right and the UICollectionViewFlowLayout.ScrollDirection is UICollectionViewScrollDirection.Vertical.

Related content


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions:

The members of UIKit.UICollectionViewFlowLayout are listed below.

See Also: UICollectionViewLayout

Public Constructors

Default constructor, initializes a new instance of this class.
A constructor that initializes the object from the data stored in the unarchiver object.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

ClassHandleIntPtr. The handle for this class.
EstimatedItemSizeCGSize. Gets or sets the size estimation that is used, for example, to calculate the height of off-screen cells.
FooterReferenceSizeCGSize. Specifies the SizeF of the footer of a UICollectionViewFlowLayout section.
HeaderReferenceSizeCGSize. The default SizeF for section headers.|The defaultSizeF for section headers.
ItemSizeCGSize. The default size of the UICollectionViewCells being displayed.
MinimumInteritemSpacingnfloat. The minimum spacing between cells in the direction of the flow (i.e., between sides if horizontal, between bottom and top if vertical).
MinimumLineSpacingnfloat. The minimum spacing between new lines of cells, in the direction of the UICollectionViewFlowLayout.ScrollDirection property (i.e., the opposite of the flow direction).
ScrollDirectionUICollectionViewScrollDirection. The scrolling direction, which is at right angles to the flow direction.
SectionFootersPinToVisibleBoundsBoolean. Gets or sets whether section footers should be pinned to the bounds.
SectionHeadersPinToVisibleBoundsBoolean. Gets or sets whether section headers should be pinned to the bounds.
SectionInsetUIEdgeInsets. Insets between sections.