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.
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 Control | Kind | Signature | Description |
|---|---|---|---|
scrollToMax | Method | scrollToMax(duration?) | Scrolls to the bottom (just before any trailing pinned header) |
scrollToTop | Method | scrollToTop(duration?) | Scrolls to the top |
onStartScroll | Event | onStartScroll = (isVertical, position) => { ... } | Runs when scrolling starts |
onUpdateScroll | Event | onUpdateScroll = (isVertical, position) => { ... } | Runs continuously while scrolling |
onStopScroll | Event | onStopScroll = (isVertical, position) => { ... } | Runs when scrolling stops |
onScrollEnd | Event | onScrollEnd = (isVertical) => { ... } | Runs when the content reaches its end (the bottom) |
Property
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 to300. A value of0or 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 to300. A value of0or less moves immediately, with no animation. - Returns: None (
void)
Example
nestedscrollID.scrollToTop(300);
Event
onStartScroll
Runs when scrolling starts.
- Kind: Event
- Parameters:
isVertical(boolean) -truewhen 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) -truefor 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) -truefor 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) -truefor a vertical axis. - Returns: None
Example
nestedscrollID.onScrollEnd = (isVertical) => {
// Code to run when the bottom is reached
};
Common Widget Control (all widgets)
Every widget can use the name-based common Widget Controls (Method) such as setProperty / getProperty / setStyleProperty. See the common reference doc (to be written).