OSATParams, TItemViewsHolderRequestChangeItemSizeAndUpdateLayout Method (Int32, Single, Boolean, Boolean) |
An item width/height can be changed with this method.
Should NOT be called during ComputeVisibilityForCurrentPosition(Boolean, Boolean), UpdateViewsHolder(TItemViewsHolder), CreateViewsHolder(Int32) or from any critical view-recycling code. Suggestion: call it from MonBehaviour.Update()
Will change the size of the item's RectTransform to requestedSize and will shift the other items accordingly, if needed.
Namespace:
Com.ForbiddenByte.OSA.Core
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax public float RequestChangeItemSizeAndUpdateLayout(
int itemIndex,
float requestedSize,
bool itemEndEdgeStationary = false,
bool computeVisibility = true
)
Parameters
- itemIndex
- Type: SystemInt32
the index of the item to be resized. It doesn't need to be visible(case in which only the cached size will be updated and, obviously, the visible items will shift accordingly) - requestedSize
- Type: SystemSingle
the height or width (depending on scrollview's orientation) - itemEndEdgeStationary (Optional)
- Type: SystemBoolean
if to grow to the top/left (less common) instead of down/right (more common) - computeVisibility (Optional)
- Type: SystemBoolean
Return Value
Type:
Singlethe resolved size. This can be slightly different than
requestedSize if the number of items is huge (>100k))
Version Information Optimized ScrollView Adapter
Supported in: 4.1
See Also