Contents

Scroll views

Enable people to scroll to content that doesn’t fit in the current display.

Overview

When the content of a view doesn’t fit in the display, you can wrap the view in a ScrollView to enable people to scroll on one or more axes. Configure the scroll view using view modifiers. For example, you can set the visibility of the scroll indicators or the availability of scrolling in a given dimension.

[Image]

You can put any view type in a scroll view, but you most often use a scroll view for a layout container with too many elements to fit in the display. For some container views that you put in a scroll view, like lazy stacks, the container doesn’t load views until they are visible or almost visible. For others, like regular stacks and grids, the container loads the content all at once, regardless of the state of scrolling.

Lists and Tables implicitly include a scroll view, so you don’t need to add scrolling to those container types. However, you can configure their implicit scroll views with the same view modifiers that apply to explicit scroll views.

For design guidance, see Scroll views in the Human Interface Guidelines.

Topics

Creating a scroll view

Managing scroll position

Defining scroll targets

Animating scroll transitions

Responding to scroll view changes

Showing scroll indicators

Managing content visibility

Disabling scrolling

Configuring scroll bounce behavior

Configuring scroll edge effects

Interacting with a software keyboard

Managing scrolling for different inputs

See Also

View layout