Layout & Rendering
VirtualViewList supports multiple layout types and granular control over spacing and render direction.
Layout Modes
| Enum | Description | Use cases |
|---|---|---|
ViewLayoutType.VERTICAL | Standard vertical list. | Chat, ranking, feed. |
ViewLayoutType.HORIZONTAL | Horizontal list. | Carousels, level selection. |
ViewLayoutType.GRID | Grid layout with vertical or horizontal main axis. | Item grids, card collections. |
Grid Direction
scrollDirection = VERTICALcolsdefines columns.girdVertRowsSpacing/girdVertColsSpacingcontrol row/column gaps.
scrollDirection = HORIZONTALrowsdefines rows.girdHoriRowsSpacing/girdHoriColsSpacingcontrol gaps.
Render Direction
verticalRenderDirectionTOP_TO_BOTTOM: top anchored (default).BOTTOM_TO_TOP: bottom anchored (useful for chat histories).
horizontalRenderDirectionLEFT_TO_RIGHTRIGHT_TO_LEFT
Spacing & Padding
itemSpacing: gap between items in list mode.paddingTop/Bottom/Left/Right: inner padding for the content node.- Grid layouts use the dedicated spacing properties listed above.
Call ReloadData() or Refresh() after updating spacing-related values.
Dynamic Sizes
- In list mode you can call
UpdateItemSize(index, size)to adjust height/width on the fly. - For precomputed sizes, pass an array via
ReloadData'scustomSizeparameter.
Visibility & Buffering
cacheRatiocontrols how many extra items to render outside the viewport.PreloadItems(count)can prepare nodes ahead of time to reduce first-scroll spikes.
Continue with Performance Tuning for detailed optimisation tips.