type ScrollEventData
The data structure contained by each UIScrollContainer.ScrollEvent.
static
type ScrollEventData = { yOffset: number; xOffset: number; horizontalVelocity: number; verticalVelocity: number; scrolledDown?: boolean; scrolledUp?: boolean; scrolledHorizontalStart?: boolean; scrolledHorizontalEnd?: boolean; atTop?: boolean; atBottom?: boolean; atHorizontalStart?: boolean; atHorizontalEnd?: boolean; }
Notes
- The platform dependent offsets
xOffset
andyOffset
can be saved and restored later using UIScrollContainer.scrollTo(). These should not be used for any other purpose. - The
horizontalVelocity
andverticalVelocity
(a number representing the approximate screen widths/heights per second), andscrolledUp
,scrolledDown
,scrolledHorizontalStart
,scrolledHorizontalEnd
(booleans) values are platform independent and represent the last scroll movement. - The boolean values of
atTop
,atBottom
,atHorizontalStart
, andatHorizontalEnd
represent the current position. These are affected by the threshold values set on the UIScrollContainer instance itself — e.g. with a top threshold of 5 pixels, theatTop
value remains true while the container is scrolled within 0-5 pixels from the top of its content.
Related
- class UIScrollContainerA view class that represents a container component that allows users to scroll, emitting asynchronous scroll events.