Skip to main content

NestedScroll (중첩 스크롤) Widget Control

The Widget Controls (Property · Method · Event) you use to control the NestedScroll widget from a script. For an introduction to the widget and how to use it, visit NestedScroll.

info

The nestedscrollID in the examples below is the name (ID) you gave the NestedScroll widget on the canvas. In a script, access members as widgetID.member.

Widget Control summary

Widget ControlKindSignatureDescription
scrollToMaxMethodscrollToMax(duration?)Scrolls to the bottom (just before any trailing pinned header)
scrollToTopMethodscrollToTop(duration?)Scrolls to the top
onStartScrollEventonStartScroll = (isVertical, position) => { ... }Runs when scrolling starts
onUpdateScrollEventonUpdateScroll = (isVertical, position) => { ... }Runs continuously while scrolling
onStopScrollEventonStopScroll = (isVertical, position) => { ... }Runs when scrolling stops
onScrollEndEventonScrollEnd = (isVertical) => { ... }Runs when the content reaches its end (the bottom)

Property

info

Not applicable — the NestedScroll widget has no script-only Property. In a script, use the common Widget Controls below (getProperty / setProperty) to read and write values.

Method

scrollToMax

Scrolls to the bottom of the view. If pinned headers sit in a row at the end, the view stops just before them and resets the inner scroll position to the top.

  • Kind: Method
  • Parameters: duration (number, optional) - animation time in milliseconds. Defaults to 300. A value of 0 or less moves immediately, with no animation.
  • Returns: None (void)

Example

nestedscrollID.scrollToMax(300);

scrollToTop

Scrolls to the top of the view.

  • Kind: Method
  • Parameters: duration (number, optional) - animation time in milliseconds. Defaults to 300. A value of 0 or less moves immediately, with no animation.
  • Returns: None (void)

Example

nestedscrollID.scrollToTop(300);

Event

onStartScroll

Runs when scrolling starts.

  • Kind: Event
  • Parameters: isVertical (boolean) - true when the scroll axis is vertical. position (number) - the current scroll position, in pixels.
  • Returns: None

Example

nestedscrollID.onStartScroll = (isVertical, position) => {
// Code to run when scrolling starts
};

onUpdateScroll

Runs continuously while scrolling.

  • Kind: Event
  • Parameters: isVertical (boolean) - true for a vertical axis. position (number) - the current scroll position, in pixels.
  • Returns: None

Example

nestedscrollID.onUpdateScroll = (isVertical, position) => {
// Code to run while scrolling
};

onStopScroll

Runs when scrolling stops.

  • Kind: Event
  • Parameters: isVertical (boolean) - true for a vertical axis. position (number) - the current scroll position, in pixels.
  • Returns: None

Example

nestedscrollID.onStopScroll = (isVertical, position) => {
// Code to run when scrolling stops
};

onScrollEnd

Runs once when scrolling reaches the end of the content (the bottom). It runs again if the view leaves the bottom and then returns to it.

  • Kind: Event
  • Parameters: isVertical (boolean) - true for a vertical axis.
  • Returns: None

Example

nestedscrollID.onScrollEnd = (isVertical) => {
// Code to run when the bottom is reached
};

Common Widget Control (all widgets)

note

Every widget can use the name-based common Widget Controls (Method) such as setProperty / getProperty / setStyleProperty. See the common reference doc (to be written).