A simple list layout that positions items from top to bottom, in a single column, where every item fills the entire width of the container.

If all items in the container should have the same height, consider using VerticalListFixedRowLayout instead. When a fixed height for items is known, that layout offers better performance optimization.

Events:

openfl.events.Event.CHANGE

Dispatched when a property of the layout changes, which triggers the container to invalidate.

Available since

1.0.0

.

Constructor

new()

Creates a new VerticalListLayout object.

Available since

1.0.0

.

Variables

@:bindable("change")contentJustify: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

.

@:bindable("change")gap:Float

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

If the gap is set to Math.POSITIVE_INFINITY, the items will be positioned as far apart as possible. In this case, the gap will never be smaller than minGap.

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

layout.gap = 20.0;
Available since

1.0.0

.

@:bindable("change")minGap:Float

If the value of the gap property is Math.POSITIVE_INFINITY, meaning that the gap will fill as much space as possible and position the items as far from each other as they can go without going outside of the view port bounds, the final calculated value of the gap will not be smaller than the value of the minGap property.

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

layout.minGap = 4.0;
Available since

1.0.0

.

@:bindable("change")paddingBottom: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

.

@:bindable("change")paddingLeft: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

.

@:bindable("change")paddingRight: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

.

@:bindable("change")paddingTop: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

.

@:bindable("change")requestedMaxRowCount: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

.

@:bindable("change")requestedMinRowCount: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

.

@:bindable("change")requestedRowCount: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 complete items:

layout.requestedRowCount = 2.0;
Available since

1.0.0

.

@:bindable("change")verticalAlign:VerticalAlign

How the content is positioned vertically (along the y-axis) within the container. If the total height of the content is larger than the available height within the container, then the positioning of the items will always start from the top.

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:

@:bindable("change")widthResetEnabled:Bool

Indicates if the width of items should be reset if the explicit width of the parent container is not set.

Available since

1.0.0

.

Methods

findNextKeyboardIndex(startIndex:Int, event:KeyboardEvent, wrapArrowKeys:Bool, items:Array<DisplayObject>, indicesToSkip:Array<Int>, viewPortWidth:Float, viewPortHeight:Float):Int

getDragDropIndex(items:Array<DisplayObject>, x:Float, y:Float, width:Float, height:Float):Int

Available since

1.3.0

.

See also:

@:value({ result : null })getDragDropRegion(items:Array<DisplayObject>, dropIndex:Int, x:Float, y:Float, width:Float, height:Float, ?result:Rectangle):Rectangle

Available since

1.3.0

.

See also:

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

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

setPadding(value:Float):Void

Sets all four padding properties to the same value.

Available since

1.0.0

.

See also: