Click or drag to resize

frame8.ScrollRectItemsAdapter.ContentSizeFitterExample Namespace

 
Classes
  ClassDescription
Public classContentSizeFitterExample

The prefabhas a disabled ContentSizeFitter added, which will be enabled in UpdateViewsHolder(MyItemViewsHolder)

if the size was not already calculated (in a previous call), then ScheduleComputeVisibilityTwinPass(Boolean) should be called.

After that, as soon as UpdateViewsHolder(MyItemViewsHolder) was called for all visible items, you'll receive a callback to OnItemHeightChangedPreTwinPass(TItemViewsHolder)

(or OnItemWidthChangedPreTwinPass(TItemViewsHolder) for horizontal ScrollRects) for each of them,

where you can disable the content size fitter.

A "Twin" ComputeVisibility(Double) pass is executed after the current one has finished (meaning UpdateViewsHolder(MyItemViewsHolder) was called for all visible items).

Public classExampleItemModel
Public classMyItemViewsHolder
The ContentSizeFitter should be attached to the item itself
Public classMyParams