StackLayout

open class StackLayout<V: View>: BaseLayout<V>

A layout that stacks sublayouts along an axis.

Axis space is allocated to sublayouts according to the distribution policy.

If this not enough space along the axis for all sublayouts then layouts with the highest flexibility are removed until there is enough space to posistion the remaining layouts.

  • Declaration

    Swift

    public func measurement(within maxSize: CGSize) -> LayoutMeasurement

    Parameters

    maxSize

    The maximum size available to the layout.

    Return Value

    The minimum size required by the layout and its sublayouts given a maximum size. The size of the layout MUST NOT exceed maxSize.

  • Declaration

    Swift

    public func arrangement(within rect: CGRect, measurement: LayoutMeasurement) -> LayoutArrangement

    Parameters

    rect

    The rectangle that the layout must position itself in.

    measurement

    A measurement which has size less than or equal to rect.size and greater than or equal to measurement.maxSize.

    Return Value

    A complete set of frames for the layout.