class HorizontalListLayout
package feathers.layout
extends EventDispatcher
implements IVirtualLayout
A simple list layout that positions items from left to right, in a single row, where every item fills the entire height of the container.
Events:
openfl.events.Event.CHANGE |
---|
1.0.0
.Constructor
Variables
contentJustify:Bool
When contentJustify
is true
, the height of the items is set to
either the explicit height of the container, or the maximum height of
all items, whichever is larger. When false
, the height of the items
is set to the explicit height of the container, even if the items are
measured to be larger.
1.0.0
.gap: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;
1.0.0
.horizontalAlign:HorizontalAlign
How the content is positioned horizontally (along the x-axis) within the container.
Note: The HorizontalAlign.JUSTIFY
constant is not supported by this
layout.
The following example aligns the container's content to the right:
layout.horizontalAlign = RIGHT;
1.0.0
.See also:
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;
1.0.0
.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;
1.0.0
.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;
1.0.0
.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;
1.0.0
.requestedColumnCount:Null<Float>
The exact number of columns to render, if the width of the container has
not been set explicitly. If null
, falls back to
requestedMinColumnCount
and requestedMaxColumnCount
.
In the following example, the layout's requested column count is set to 2 complete items:
layout.requestedColumnCount = 2.0;
1.0.0
.requestedMaxColumnCount:Null<Float>
The maximum number of columns to render, if the width of the container
has not been set explicitly. If null
, the maximum number of columns is
the total number of items displayed by the layout.
If requestedColumnCount
is also set, this property is ignored.
In the following example, the layout's requested maximum column count is set to 5 complete items:
layout.requestedMaxColumnCount = 5.0;
1.0.0
.requestedMinColumnCount:Null<Float>
The minimum number of columns to render, if the width of the container
has not been set explicitly. If null
, this property is ignored.
If requestedColumnCount
is also set, this property is ignored.
In the following example, the layout's requested minimum coumn count is set to 2 complete items:
layout.requestedMinColumnCount = 2.0;
1.0.0
.Methods
getNearestScrollPositionForIndex(index:Int, itemCount:Int, width:Float, height:Float, ?result:Point):Point
getVisibleIndices(itemCount:Int, width:Float, height:Float, ?result:VirtualLayoutRange):VirtualLayoutRange
layout(items:Array<DisplayObject>, measurements:Measurements, ?result:LayoutBoundsResult):LayoutBoundsResult
See also:
setPadding(value:Float):Void
Sets all four padding properties to the same value.
1.0.0
.See also: