A simple list layout that positions items from top to bottom, in a single column, where every item has the same width and height. The items fill the entire width of the container. The height of items is determined by the measured height of the first item, or it may be overridden using the rowHeight property.

Events:

openfl.events.Event.CHANGE
Available since

1.0.0

.

Constructor

new()

Creates a new VerticalListFixedRowLayout object.

Available since

1.0.0

.

Variables

@:flash.propertycontentJustify:Bool

When contentJustify is true, the width of the items is set to either the explicit width of the container, or the maximum width of all items, whichever is larger. When false, the width of the items is set to the explicit width of the container, even if the items are measured to be larger.

Available since

1.0.0

.

@:flash.propertyread onlyelasticBottom:Bool

@:flash.propertyread onlyelasticLeft:Bool

@:flash.propertyread onlyelasticRight:Bool

@:flash.propertyread onlyelasticTop:Bool

@:flash.propertygap:Float

The space, in pixels, between each two adjacent items in the layout.

In the following example, the layout's gap is set to 20 pixels:

layout.gap = 20.0;
Available since

1.0.0

.

@:flash.propertypaddingBottom:Float

The space, in pixels, between the parent container's bottom edge and its content.

In the following example, the layout's bottom padding is set to 20 pixels:

layout.paddingBottom = 20.0;
Available since

1.0.0

.

@:flash.propertypaddingLeft:Float

The space, in pixels, between the parent container's left edge and its content.

In the following example, the layout's left padding is set to 20 pixels:

layout.paddingLeft = 20.0;
Available since

1.0.0

.

@:flash.propertypaddingRight:Float

The space, in pixels, between the parent container's right edge and its content.

In the following example, the layout's right padding is set to 20 pixels:

layout.paddingRight = 20.0;
Available since

1.0.0

.

@:flash.propertypaddingTop:Float

The space, in pixels, between the parent container's top edge and its content.

In the following example, the layout's top padding is set to 20 pixels:

layout.paddingTop = 20.0;
Available since

1.0.0

.

@:flash.propertyrequestedMaxRowCount:Null<Float>

The maximum number of rows to render, if the height of the container has not been set explicitly. If null, the maximum number of rows is the total number of items displayed by the layout.

If requestedRowCount is also set, this property is ignored.

In the following example, the layout's requested maximum row count is set to 5 complete items:

layout.requestedMaxRowCount = 5.0;
Available since

1.0.0

.

@:flash.propertyrequestedMinRowCount:Null<Float>

The minimum number of rows to render, if the height of the container has not been set explicitly. If null, this property is ignored.

If requestedRowCount is also set, this property is ignored.

In the following example, the layout's requested minimum row count is set to 2 complete items:

layout.requestedMinRowCount = 2.0;
Available since

1.0.0

.

@:flash.propertyrequestedRowCount:Null<Float>

The exact number of rows to render, if the height of the container has not been set explicitly. If null, falls back to requestedMinRowCount and requestedMaxRowCount.

In the following example, the layout's requested row count is set to 2 items:

layout.requestedRowCount = 2.0;
Available since

1.0.0

.

@:flash.propertyrowHeight:Null<Float>

The height to set on each item, or null, if the row height should be calculated automatically.

In the following example, the layout's row height is set to 20 pixels:

layout.rowHeight = 20.0;
Available since

1.0.0

.

@:flash.propertyscrollX:Float

@:flash.propertyscrollY:Float

@:flash.propertyverticalAlign:VerticalAlign

How the content is positioned vertically (along the y-axis) within the container.

Note: The VerticalAlign.JUSTIFY constant is not supported by this layout.

The following example aligns the container's content to the bottom:

layout.verticalAlign = BOTTOM;
Available since

1.0.0

.

See also:

@:flash.propertyvirtualCache:Array<Dynamic>

Methods

getNearestScrollPositionForIndex(index:Int, itemCount:Int, width:Float, height:Float, ?result:Point):Point

layout(items:Array<DisplayObject>, measurements:Measurements, ?result:LayoutBoundsResult):LayoutBoundsResult