A layout algorithm that supports virtualization of items. In other words, only the items that are visible need to be created as display objects, and those outside of the view port bounds are represented with empty space until they are scrolled into view. Useful in components like ListView, TreeView, or GridView where dozens or hundreds of items are needed, but only a small subset of them are visible at any given moment.

Available since

1.0.0

.

Variables

virtualCache:Array<Dynamic>

Used by the layout to store additional data for virtual items (items that are not currently represeted by display objects). For instance, it might store the width and height of an item so that this value may be used to calculate the total layout dimensions when the item is out of bounds.

Available since

1.0.0

.

Methods

getVisibleIndices(itemCount:Int, width:Float, height:Float, ?result:VirtualLayoutRange):VirtualLayoutRange

Used internally by a UI component (such as ListView, TreeView, or GridView) to determine which indices are visible with the specified view port bounds and scroll position. Indices that aren't included in the result typically do not receive display objects to represent them.

Available since

1.0.0

.

See also: