πŸš€ 8.9 Released! β†’ ⚑️ New Node-API Engine Preview, πŸ“² ns widget ios, πŸ’… Tailwind v4 and more...
Read Announcement

<ScrollView> is a UI component for rendering scrollable content. Content can be scrolled vertically (default) or horizontally.

Note

A ScrollView can only have a single child element.

xml
<ScrollView>
 <StackLayoutpadding="12">
 <Labeltext="v1"height="50" />
 <Labeltext="v2"height="50" />
 <Labeltext="v3"height="50" />
 <Labeltext="v4"height="50" />
 <Labeltext="v5"height="50" />
 <Labeltext="v6"height="50" />
 <Labeltext="v7"height="50" />
 <Labeltext="v8"height="50" />
 <Labeltext="v9"height="50" />
 </StackLayout>
</ScrollView>
html
<ScrollView>
 <StackLayoutpadding="12">
 <Labeltext="v1"height="50"></Label>
 <Labeltext="v2"height="50"></Label>
 <Labeltext="v3"height="50"></Label>
 <Labeltext="v4"height="50"></Label>
 <Labeltext="v5"height="50"></Label>
 <Labeltext="v6"height="50"></Label>
 <Labeltext="v7"height="50"></Label>
 <Labeltext="v8"height="50"></Label>
 <Labeltext="v9"height="50"></Label>
 </StackLayout>
</ScrollView>
tsx
<gridLayoutrows="*, 50, 300, *">
 <scrollVieworientation="horizontal"row="1">
 <stackLayoutorientation="horizontal"padding="12">
 <labeltext="h1"width="50"></label>
 <labeltext="h2"width="50"></label>
 <labeltext="h3"width="50"></label>
 <labeltext="h4"width="50"></label>
 <labeltext="h5"width="50"></label>
 <labeltext="h6"width="50"></label>
 <labeltext="h7"width="50"></label>
 <labeltext="h8"width="50"></label>
 <labeltext="h9"width="50"></label>
 </stackLayout>
 </scrollView>

 <contentViewrow="2">
 <scrollView>
 <stackLayoutpadding="12">
 <labeltext="v1"height="50"></label>
 <labeltext="v2"height="50"></label>
 <labeltext="v3"height="50"></label>
 <labeltext="v4"height="50"></label>
 <labeltext="v5"height="50"></label>
 <labeltext="v6"height="50"></label>
 <labeltext="v7"height="50"></label>
 <labeltext="v8"height="50"></label>
 <labeltext="v9"height="50"></label>
 </stackLayout>
 </scrollView>
tsx
<scrollview>
 <stacklayoutpadding="12">
 <labeltext="v1"height="50"></label>
 <labeltext="v2"height="50"></label>
 <labeltext="v3"height="50"></label>
 <labeltext="v4"height="50"></label>
 <labeltext="v5"height="50"></label>
 <labeltext="v6"height="50"></label>
 <labeltext="v7"height="50"></label>
 <labeltext="v8"height="50"></label>
 <labeltext="v9"height="50"></label>
 </stacklayout>
</scrollview>
svelte
<scrollView>
 <stackLayoutpadding="12">
 <labeltext="v1"height="50"></label>
 <labeltext="v2"height="50"></label>
 <labeltext="v3"height="50"></label>
 <labeltext="v4"height="50"></label>
 <labeltext="v5"height="50"></label>
 <labeltext="v6"height="50"></label>
 <labeltext="v7"height="50"></label>
 <labeltext="v8"height="50"></label>
 <labeltext="v9"height="50"></label>
 </stackLayout>
</scrollView>
vue
<ScrollView>
 <StackLayout padding="12">
 <Label text="v1" height="50"></Label>
 <Label text="v2" height="50"></Label>
 <Label text="v3" height="50"></Label>
 <Label text="v4" height="50"></Label>
 <Label text="v5" height="50"></Label>
 <Label text="v6" height="50"></Label>
 <Label text="v7" height="50"></Label>
 <Label text="v8" height="50"></Label>
 <Label text="v9" height="50"></Label>
 </StackLayout>
</ScrollView>

Props ​

orientation ​

ts
orientation: 'horizontal'|'vertical'

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

Defaults to vertical.

scrollBarIndicatorVisible ​

ts
scrollBarIndicatorVisible: boolean

Specifies if the scrollbar is visible.

Defaults to true.

isScrollEnabled ​

ts
isScrollEnabled: boolean

Enables or disables scrolling of the ScrollView.

verticalOffset ​

ts
verticalOffset: number

Gets the vertical offset of the scrolled content.

horizontalOffset ​

ts
horizontalOffset: number

Gets the horizontal offset of the scrolled content.

scrollableHeight ​

ts
scrollableHeight: number

Gets the maximum scrollable height, this is also the maximum value for the verticalOffset.

scrollableWidth ​

ts
scrollableWidth: number = scrollView.scrollableWidth

Gets the maximum scrollable width, this is also the maximum value for the horizontalOffset.

Methods ​

scrollToVerticalOffset() ​

ts
scrollToVerticalOffset(value: number, animated: boolean)

Scrolls the content to the specified vertical offset.

Set animated to true for animated scroll, false for immediate scroll.

scrollToHorizontalOffset() ​

ts
scrollToHorizontalOffset(value: number, animated: boolean)

Scrolls the content to the specified horizontal offset position.

Set animated to true for animated scroll, false for immediate scroll.

Events ​

scroll ​

ts
on('scroll', (args:ScrollEventData) => {
constscrollView= args.object asScrollView
 console.log('Scrolled', {
 scrollX: args.scrollX,
 scrollY: args.scrollY,
 })
})

Emitted when the ScrollView is scrolled.

See ScrollEventData.

Native component ​

Previous
Progress

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /