MeasuredLinearLayoutProvider
此内容尚不支持你的语言。
Defined in: ui/collection/layout-provider.ts:109
A linear list whose items vary along the main axis (e.g. chat bubbles that grow
with their wrapped text). Item offsets are prefix-summed and cached; the cache
rebuilds when the item count changes or invalidate is called (a data or
measurement change — the ListView invalidates on both). mainSizeOf is the
app’s measure hook, so the list stays measurement-agnostic.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MeasuredLinearLayoutProvider(
opts):MeasuredLinearLayoutProvider
Defined in: ui/collection/layout-provider.ts:119
Parameters
Section titled “Parameters”MeasuredLinearLayoutOptions
Returns
Section titled “Returns”MeasuredLinearLayoutProvider
Methods
Section titled “Methods”getContentSize()
Section titled “getContentSize()”getContentSize(
count):Vec2
Defined in: ui/collection/layout-provider.ts:144
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getItemRect()
Section titled “getItemRect()”getItemRect(
index):Rect
Defined in: ui/collection/layout-provider.ts:151
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Rect
Implementation of
Section titled “Implementation of”getVisibleRange()
Section titled “getVisibleRange()”getVisibleRange(
viewport,count): [number,number]
Defined in: ui/collection/layout-provider.ts:160
Inclusive start, exclusive end. Returns [0, 0] when nothing is visible.
Parameters
Section titled “Parameters”viewport
Section titled “viewport”Rect
number
Returns
Section titled “Returns”[number, number]
Implementation of
Section titled “Implementation of”LayoutProvider.getVisibleRange
invalidate()
Section titled “invalidate()”invalidate():
void
Defined in: ui/collection/layout-provider.ts:127
Re-measure on the next query (an item’s data/size changed, not just the count).
Returns
Section titled “Returns”void