8.7 released—WinterCG Compliance Part 1
Learn more
ScrollView
Represents a scrollable area that can have content that is larger than its bounds.

Summary

Constructors

constructor

Properties

horizontalOffset
isScrollEnabled
orientation
scrollableHeight
scrollableWidth
scrollBarIndicatorVisible
scrollEvent
verticalOffset
155 properties inherited from ContentView
Click to expand

Methods

_onOrientationChanged
on
scrollToHorizontalOffset
scrollToVerticalOffset
113 methods inherited from ContentView
Click to expand

Constructors

constructor

new ScrollView(): ScrollView

Properties

horizontalOffset

horizontalOffset: number
Gets a value that contains the horizontal offset of the scrolled content.

isScrollEnabled

isScrollEnabled: boolean
Gets or sets a value indicating whether scroll is enabled.

orientation

orientation: OrientationType
Gets or sets direction in which the content can be scrolled.

scrollBarIndicatorVisible

scrollBarIndicatorVisible: boolean
Toggles scrollbar indicator visibility

scrollableHeight

scrollableHeight: number
Gets the maximum value for the verticalOffset.

scrollableWidth

scrollableWidth: number
Gets the maximum value for the horizontalOffset.

verticalOffset

verticalOffset: number
Gets a value that contains the vertical offset of the scrolled content.

scrollEvent

Static
scrollEvent: string
String value used when hooking to scroll event.

Methods

_onOrientationChanged

_onOrientationChanged(): void

on

on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void
A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
Parameter Default Description
eventNames
string

String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").

callback
(data: EventData) => void

Callback function which will be executed when event is raised.

thisArg
any

An optional parameter which will be used as `this` context for callback execution.

Returns void
on(event: "scroll", callback: (args: ScrollEventData) => void, thisArg?: any): void
Raised when a scroll event occurs.
Parameter Default Description
event
"scroll"

callback
(args: ScrollEventData) => void

thisArg
any

Returns void

scrollToHorizontalOffset

scrollToHorizontalOffset(value: number, animated: boolean): any
Scrolls the content the specified horizontal offset position.
Parameter Default Description
value
number

The offset value

animated
boolean

true for animated scroll, false for immediate scroll.

Returns any

scrollToVerticalOffset

scrollToVerticalOffset(value: number, animated: boolean): any
Scrolls the content the specified vertical offset position.
Parameter Default Description
value
number

The offset value

animated
boolean

true for animated scroll, false for immediate scroll.

Returns any
Previous
Screen