CollectionViewItemFrame

ceramic.CollectionViewItemFrame (Class)

Represents the position and dimensions of an item in a CollectionView.

Each item in the collection has a corresponding frame that defines where it should be positioned and how large it should be. The CollectionView uses this information to:

  • Determine which items are visible
  • Position item views correctly
  • Calculate content size for scrolling

Frames are managed internally by CollectionView and its layout. The data source provides width/height, while the layout sets x/y positions.

Instance Members

ui
x: Float

The X coordinate of the item's position within the content area. Set by the layout during positioning.


ui
y: Float

The Y coordinate of the item's position within the content area. Set by the layout during positioning.


ui
width: Float

The width of the item in pixels. Should be set by the data source in collectionViewItemFrameAtIndex().


ui
height: Float

The height of the item in pixels. Should be set by the data source in collectionViewItemFrameAtIndex().


ui
visible: Bool

Whether this item is currently visible in the viewport. Managed internally by CollectionView based on scroll position. When false, the associated view may be recycled.


ui
view: View

The view currently displaying this item, if any. Will be null for items that are not visible or when using lazy loading. Managed internally by CollectionView's view recycling system.


ui
new(x: Float, y: Float, width: Float, height: Float): Void

Creates a new item frame with the specified dimensions.

Name Type Description
x Float Initial X position
y Float Initial Y position
width Float Item width
height Float Item height

Private Members

ui
toString(): String

Returns a string representation of this frame for debugging.

Returns Description
String String in format "Frame(x=X y=Y w=WIDTH h=HEIGHT)"

Metadata

Name Parameters
:allow ceramic.CollectionView