Contents

ScrollAnchorRole

A type defining the role of a scroll anchor.

Declaration

struct ScrollAnchorRole

Overview

You can associate a UnitPoint to a ScrollView using the defaultScrollAnchor(_:) modifier. By default, the system uses this point for different kinds of behaviors including:

  • Where the scroll view should initially be scrolled

  • How the scroll view should handle content size or container size changes

  • How the scroll view should align content smaller than its container size

You can further customize this behavior by assigning different unit points for these different roles.

Topics

Type Properties

See Also

Managing scroll position