OSATParams, TItemViewsHolderScrollTo Method |
By default, it aligns the ScrollView's content so that the item with itemIndex will be at the top.
But the two optional parameters can be used for more fine-tuning. One common use-case is to set them both at 0.5 so the item will be end up exactly in the middle of the viewport
Namespace:
Com.ForbiddenByte.OSA.Core
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax public virtual void ScrollTo(
int itemIndex,
float normalizedOffsetFromViewportStart = 0f,
float normalizedPositionOfItemPivotToUse = 0f
)
Parameters
- itemIndex
- Type: SystemInt32
The item with this index will be considered - normalizedOffsetFromViewportStart (Optional)
- Type: SystemSingle
0f=no effect; 0.5f= the item's start edge (top or left) will be at the viewport's center; 1f=the item's start edge will be exactly at the viewport's end (thus, the item will be completely invisible) - normalizedPositionOfItemPivotToUse (Optional)
- Type: SystemSingle
For even more fine-adjustment, you can also specify what point on the item will be used to bring it to normalizedOffsetFromViewportStart. The same principle applies as to the normalizedOffsetFromViewportStart parameter: 0f=start(top/left), 1f=end(bottom/right)
Implements
IOSAScrollTo(Int32, Single, Single)Version Information Optimized ScrollView Adapter
Supported in: 4.1
See Also