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
xOffsetandyOffsetcan be saved and restored later using UIScrollContainer.scrollTo(). These should not be used for any other purpose. - The
horizontalVelocityandverticalVelocity(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, andatHorizontalEndrepresent 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, theatTopvalue 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.
