Import
Basic Usage
Props
Layout Props
These styles will be applied to the scroll view content container which wraps all of the child views.
When true, the scroll view’s children are arranged horizontally in a row instead of vertically in a column.
Styles to apply to the scroll view container.
Scrolling Behavior
When true, the scroll view stops on multiples of the scroll view’s size when scrolling. This can be used for horizontal pagination.
When false, the content does not scroll.
A floating-point number that determines how quickly the scroll view decelerates after the user lifts their finger.
normal- 0.998 on iOS, 0.985 on Androidfast- 0.99 on iOS, 0.9 on Android
When set, causes the scroll view to stop at multiples of the value of snapToInterval. This can be used for paginating through children that have lengths smaller than the scroll view.
When set, causes the scroll view to stop at the defined offsets. This can be used for paginating through variously sized children.
Use in conjunction with snapToOffsets. By default, the beginning of the list counts as a snap offset. Set to false to disable this behavior.
Use in conjunction with snapToOffsets. By default, the end of the list counts as a snap offset. Set to false to disable this behavior.
When true, the scroll view stops on the next index (in relation to scroll position at release) regardless of how fast the gesture is.
Content Offset
Used to manually set the starting scroll offset.
Keyboard Behavior
Determines whether the keyboard gets dismissed in response to a drag.
none- Drags do not dismiss the keyboardon-drag- The keyboard is dismissed when a drag beginsinteractive- (iOS only) The keyboard is dismissed interactively with the drag
Determines when the keyboard should stay visible after a tap.
never- Tapping outside of the focused text input dismisses the keyboardalways- The keyboard will not dismiss automaticallyhandled- The keyboard will not dismiss automatically when the tap was handled by children
Scroll Indicators
When true, shows a horizontal scroll indicator.
When true, shows a vertical scroll indicator.
Performance
Experimental: When true, offscreen child views are removed from their native backing superview when offscreen. This can improve scrolling performance on long lists.
Event Handlers
Fires at most once per frame during scrolling. The frequency can be controlled using the
scrollEventThrottle prop.Called when the user begins to drag the scroll view.
Called when the user stops dragging the scroll view and it either stops or begins to glide.
Called when the momentum scroll starts (scroll which occurs as the ScrollView glides to a stop).
Called when the momentum scroll ends (scroll which occurs as the ScrollView glides to a stop).
Called when scrollable content view of the ScrollView changes.
This controls how often the scroll event will be fired while scrolling (in milliseconds). A lower number yields better accuracy for code that is tracking the scroll position, but can lead to scroll performance problems. The default value is zero, which results in the scroll event being sent only once per frame.
Identification Props
Used to locate this view in end-to-end tests.
Platform-Specific Props
- iOS
- Android
When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.
When true, the scroll view bounces horizontally when it reaches the end even if the content is smaller than the scroll view itself. Default is true when
horizontal={true} and false otherwise.When true, the scroll view bounces vertically when it reaches the end even if the content is smaller than the scroll view itself. Default is false when
horizontal={true} and true otherwise.Controls whether iOS should automatically adjust the content inset for scroll views that are placed behind a navigation bar or tab bar.
Controls whether the ScrollView should automatically adjust its
contentInset and scrollViewInsets when the Keyboard changes its size.Controls whether iOS should automatically adjust the scroll indicator insets. Available on iOS 13 and later.
The amount by which the scroll view content is inset from the edges of the scroll view.
This property specifies how the safe area insets are used to modify the content area of the scroll view.
The amount by which the scroll view indicators are inset from the edges of the scroll view.
When true, the scroll view scrolls to top when the status bar is tapped.
The style of the scroll indicators.
When true, the ScrollView will try to lock to only vertical or horizontal scrolling while dragging.
The maximum allowed zoom scale.
The minimum allowed zoom scale.
When true, ScrollView allows use of pinch gestures to zoom in and out.
Methods
Scrolls to a given x, y offset, either immediately or with a smooth animation.
Scrolls to the end of the ScrollView.
Displays the scroll indicators momentarily.