Docs (4.0.0)
class UIScrollContainer type

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 and yOffset can be saved and restored later using UIScrollContainer.scrollTo(). These should not be used for any other purpose.
  • The horizontalVelocity and verticalVelocity (a number representing the approximate screen widths/heights per second), and scrolledUp, scrolledDown, scrolledHorizontalStart, scrolledHorizontalEnd (booleans) values are platform independent and represent the last scroll movement.
  • The boolean values of atTop, atBottom, atHorizontalStart, and atHorizontalEnd 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, the atTop 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.