Files
react-native/docs/scrollview.html
T
2020-11-16 01:10:26 +00:00

45 lines
81 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.66">
<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="React Native Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="React Native Blog Atom Feed">
<link rel="preconnect" href="https://www.google-analytics.com">
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-41298772-2","auto"),ga("send","pageview")</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-41298772-2"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-41298772-2",{})</script>
<link rel="search" type="application/opensearchdescription+xml" title="React Native" href="/opensearch.xml">
<script src="https://cdn.jsdelivr.net/npm/focus-visible@5.0.2/dist/focus-visible.min.js" defer="defer"></script>
<script src="https://snack.expo.io/embed.js" defer="defer"></script><title data-react-helmet="true">ScrollView · React Native</title><meta data-react-helmet="true" property="twitter:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" name="twitter:image:alt" content="Image for React Native"><meta data-react-helmet="true" name="docsearch:language" content="en"><meta data-react-helmet="true" name="docsearch:version" content="0.63"><meta data-react-helmet="true" name="docsearch:docusaurus_tag" content="docs-default-0.63"><meta data-react-helmet="true" property="og:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" name="twitter:card" content="summary"><meta data-react-helmet="true" name="twitter:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" property="og:title" content="ScrollView · React Native"><meta data-react-helmet="true" name="description" content="Component that wraps platform ScrollView while providing integration with touch locking &quot;responder&quot; system."><meta data-react-helmet="true" property="og:description" content="Component that wraps platform ScrollView while providing integration with touch locking &quot;responder&quot; system."><meta data-react-helmet="true" property="og:url" content="https://reactnative.dev/docs/scrollview"><link data-react-helmet="true" rel="shortcut icon" href="/img/favicon.ico"><link data-react-helmet="true" rel="preconnect" href="https://BH4D9OD16A-dsn.algolia.net" crossorigin="anonymous"><link data-react-helmet="true" rel="canonical" href="https://reactnative.dev/docs/scrollview"><link rel="stylesheet" href="/styles.bc3f26fc.css">
<link rel="stylesheet" href="/main.27dc9db6.css">
<link rel="preload" href="/styles.473a8a2f.js" as="script">
<link rel="preload" href="/runtime~main.7f7b2f9b.js" as="script">
<link rel="preload" href="/main.cfaa289e.js" as="script">
<link rel="preload" href="/1.b8ab3a64.js" as="script">
<link rel="preload" href="/2.728a4992.js" as="script">
<link rel="preload" href="/1f391b9e.0c09adb2.js" as="script">
<link rel="preload" href="/940.3ab6ef7d.js" as="script">
<link rel="preload" href="/ee5b3385.81eddc93.js" as="script">
<link rel="preload" href="/17896441.ca368bf1.js" as="script">
<link rel="preload" href="/f9b8463d.e4a0a711.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<nav class="navbar navbar--fixed-top navbar--dark"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/"><img class="navbar__logo" src="/img/header_logo.svg" alt="React Native"><strong class="navbar__title">React Native</strong></a><div class="navbar__item dropdown dropdown--hoverable dropdown--left"><a class="navbar__item navbar__link" href="/docs/getting-started">0.63</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/docs/next/scrollview">Next</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/docs/scrollview">0.63</a></li><li><a class="dropdown__link" href="/docs/0.62/scrollview">0.62</a></li><li><a class="dropdown__link" href="/docs/0.61/scrollview">0.61</a></li><li><a class="dropdown__link" href="/docs/0.60/scrollview">0.60</a></li><li><a class="dropdown__link" href="/versions">All versions</a></li></ul></div></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/docs/getting-started">Docs</a><a class="navbar__item navbar__link navbar__link--active" href="/docs/components-and-apis">Components</a><a class="navbar__item navbar__link" href="/docs/accessibilityinfo">API</a><a class="navbar__item navbar__link" href="/help">Community</a><a class="navbar__item navbar__link" href="/blog">Blog</a><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link navbar-github-link" aria-label="GitHub repository"></a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_2aTZ"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_BsTx">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_BsTx">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span><span class="DocSearch-Button-Key"></span><span class="DocSearch-Button-Key">K</span></button></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img class="navbar__logo" src="/img/header_logo.svg" alt="React Native"><strong class="navbar__title">React Native</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/docs/getting-started">Docs</a></li><li class="menu__list-item"><a class="menu__link navbar__link--active" href="/docs/components-and-apis">Components</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/accessibilityinfo">API</a></li><li class="menu__list-item"><a class="menu__link" href="/help">Community</a></li><li class="menu__list-item"><a class="menu__link" href="/blog">Blog</a></li><li class="menu__list-item"><a role="button" class="menu__link menu__link--sublist">Versions</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/docs/next/scrollview">Next</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active" href="/docs/scrollview">0.63</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.62/scrollview">0.62</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.61/scrollview">0.61</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.60/scrollview">0.60</a></li><li class="menu__list-item"><a class="menu__link" href="/versions">All versions</a></li></ul></li><li class="menu__list-item"><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="menu__link navbar-github-link" aria-label="GitHub repository"></a></li></ul></div></div></div></nav><div class="main-wrapper"><div class="docPage_2gpo"><div class="docSidebarContainer_3_JD" role="complementary"><div class="sidebar_2urC"><div class="menu menu--responsive menu_5FrY"><button aria-label="Open Menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_Dm3K" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 32 32" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">Core Components</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/components-and-apis">Core Components and APIs</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/activityindicator">ActivityIndicator</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/button">Button</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/flatlist">FlatList</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/image">Image</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/imagebackground">ImageBackground</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/keyboardavoidingview">KeyboardAvoidingView</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modal">Modal</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/pressable">Pressable</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/refreshcontrol">RefreshControl</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/docs/scrollview">ScrollView</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/sectionlist">SectionList</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/statusbar">StatusBar</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/switch">Switch</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/text">Text</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/textinput">TextInput</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchablehighlight">TouchableHighlight</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchableopacity">TouchableOpacity</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchablewithoutfeedback">TouchableWithoutFeedback</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/view">View</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/virtualizedlist">VirtualizedList</a></li><li class="menu__list-item"><a class="menu__link menu__link--sublist" href="#!" tabindex="0">Android Components</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/drawerlayoutandroid">DrawerLayoutAndroid</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchablenativefeedback">TouchableNativeFeedback</a></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist" href="#!" tabindex="0">iOS Components</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/inputaccessoryview">InputAccessoryView</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/maskedviewios">🚧 MaskedViewIOS</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/safeareaview">SafeAreaView</a></li></ul></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Props</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/image-style-props">Image Style Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/layout-props">Layout Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/shadow-props">Shadow Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/text-style-props">Text Style Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/view-style-props">View Style Props</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Object Types</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/pressevent">PressEvent Object Type</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/react-node">React Node Object Type</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/rect">Rect Object Type</a></li></ul></li></ul></div></div></div><main class="docMainContainer_3EyW"><div class="container padding-vert--lg docItemWrapper_1Hme"><div class="row"><div class="col docItemCol_2AGf"><div class="docItemContainer_1tAC"><article><header><h1 class="docTitle_cWlf">ScrollView</h1></header><div class="markdown"><p>Component that wraps platform ScrollView while providing integration with touch locking &quot;responder&quot; system.</p><p>Keep in mind that ScrollViews must have a bounded height in order to work, since they contain unbounded-height children into a bounded container (via a scroll interaction). In order to bound the height of a ScrollView, either set the height of the view directly (discouraged) or make sure all parent views have bounded height. Forgetting to transfer <code>{flex: 1}</code> down the view stack can lead to errors here, which the element inspector makes quick to debug.</p><p>Doesn&#x27;t yet support other contained responders from blocking this scroll view from becoming the responder.</p><p><code>&lt;ScrollView&gt;</code> vs <a href="/docs/flatlist"><code>&lt;FlatList&gt;</code></a> - which one to use?</p><p><code>ScrollView</code> renders all its react child components at once, but this has a performance downside.</p><p>Imagine you have a very long list of items you want to display, maybe several screens worth of content. Creating JS components and native views for everything all at once, much of which may not even be shown, will contribute to slow rendering and increased memory usage.</p><p>This is where <code>FlatList</code> comes into play. <code>FlatList</code> renders items lazily, when they are about to appear, and removes items that scroll way off screen to save memory and processing time.</p><p><code>FlatList</code> is also handy if you want to render separators between your items, multiple columns, infinite scroll loading, or any number of other features it supports out of the box.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="example"></a>Example<a aria-hidden="true" tabindex="-1" class="hash-link" href="#example" title="Direct link to heading">#</a></h2><div class="snack-player" data-snack-name="ScrollView" data-snack-description="Example usage" data-snack-code="import%20React%20from%20&#x27;react&#x27;%3B%0Aimport%20%7B%20StyleSheet%2C%20Text%2C%20SafeAreaView%2C%20ScrollView%20%7D%20from%20&#x27;react-native&#x27;%3B%0Aimport%20Constants%20from%20&#x27;expo-constants&#x27;%3B%0A%0Aconst%20App%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CSafeAreaView%20style%3D%7Bstyles.container%7D%3E%0A%20%20%20%20%20%20%3CScrollView%20style%3D%7Bstyles.scrollView%7D%3E%0A%20%20%20%20%20%20%20%20%3CText%20style%3D%7Bstyles.text%7D%3E%0A%20%20%20%20%20%20%20%20%20%20Lorem%20ipsum%20dolor%20sit%20amet%2C%20consectetur%20adipiscing%20elit%2C%20sed%20do%0A%20%20%20%20%20%20%20%20%20%20eiusmod%20tempor%20incididunt%20ut%20labore%20et%20dolore%20magna%20aliqua.%20Ut%20enim%20ad%0A%20%20%20%20%20%20%20%20%20%20minim%20veniam%2C%20quis%20nostrud%20exercitation%20ullamco%20laboris%20nisi%20ut%0A%20%20%20%20%20%20%20%20%20%20aliquip%20ex%20ea%20commodo%20consequat.%20Duis%20aute%20irure%20dolor%20in%0A%20%20%20%20%20%20%20%20%20%20reprehenderit%20in%20voluptate%20velit%20esse%20cillum%20dolore%20eu%20fugiat%20nulla%0A%20%20%20%20%20%20%20%20%20%20pariatur.%20Excepteur%20sint%20occaecat%20cupidatat%20non%20proident%2C%20sunt%20in%0A%20%20%20%20%20%20%20%20%20%20culpa%20qui%20officia%20deserunt%20mollit%20anim%20id%20est%20laborum.%0A%20%20%20%20%20%20%20%20%3C%2FText%3E%0A%20%20%20%20%20%20%3C%2FScrollView%3E%0A%20%20%20%20%3C%2FSafeAreaView%3E%0A%20%20)%3B%0A%7D%0A%0Aconst%20styles%20%3D%20StyleSheet.create(%7B%0A%20%20container%3A%20%7B%0A%20%20%20%20flex%3A%201%2C%0A%20%20%20%20marginTop%3A%20Constants.statusBarHeight%2C%0A%20%20%7D%2C%0A%20%20scrollView%3A%20%7B%0A%20%20%20%20backgroundColor%3A%20&#x27;pink&#x27;%2C%0A%20%20%20%20marginHorizontal%3A%2020%2C%0A%20%20%7D%2C%0A%20%20text%3A%20%7B%0A%20%20%20%20fontSize%3A%2042%2C%0A%20%20%7D%2C%0A%7D)%3B%0A%0Aexport%20default%20App%3B" data-snack-platform="web" data-snack-supported-platforms="ios,android,web" data-snack-theme="light" data-snack-preview="true"></div><hr><h1><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="reference"></a>Reference<a aria-hidden="true" tabindex="-1" class="hash-link" href="#reference" title="Direct link to heading">#</a></h1><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="props"></a>Props<a aria-hidden="true" tabindex="-1" class="hash-link" href="#props" title="Direct link to heading">#</a></h2><p>Inherits <a href="/docs/view#props">View Props</a>.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="alwaysbouncehorizontal"></a><code>alwaysBounceHorizontal</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#alwaysbouncehorizontal" title="Direct link to heading">#</a></h3><p>When true, the scroll view bounces horizontally when it reaches the end even if the content is smaller than the scroll view itself. The default value is true when <code>horizontal={true}</code> and false otherwise.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="alwaysbouncevertical"></a><code>alwaysBounceVertical</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#alwaysbouncevertical" title="Direct link to heading">#</a></h3><p>When true, the scroll view bounces vertically when it reaches the end even if the content is smaller than the scroll view itself. The default value is false when <code>horizontal={true}</code> and true otherwise.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="automaticallyadjustcontentinsets"></a><code>automaticallyAdjustContentInsets</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#automaticallyadjustcontentinsets" title="Direct link to heading">#</a></h3><p>Controls whether iOS should automatically adjust the content inset for scroll views that are placed behind a navigation bar or tab bar/ toolbar. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="bounces"></a><code>bounces</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#bounces" title="Direct link to heading">#</a></h3><p>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 false, it disables all bouncing even if the <code>alwaysBounce*</code> props are true. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="bounceszoom"></a><code>bouncesZoom</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#bounceszoom" title="Direct link to heading">#</a></h3><p>When true, gestures can drive zoom past min/max and the zoom will animate to the min/max value at gesture end, otherwise the zoom will not exceed the limits.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="cancancelcontenttouches"></a><code>canCancelContentTouches</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#cancancelcontenttouches" title="Direct link to heading">#</a></h3><p>When false, once tracking starts, won&#x27;t try to drag if the touch moves. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="centercontent"></a><code>centerContent</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#centercontent" title="Direct link to heading">#</a></h3><p>When true, the scroll view automatically centers the content when the content is smaller than the scroll view bounds; when the content is larger than the scroll view, this property has no effect. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="contentcontainerstyle"></a><code>contentContainerStyle</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#contentcontainerstyle" title="Direct link to heading">#</a></h3><p>These styles will be applied to the scroll view content container which wraps all of the child views. Example:</p><div class="mdxCodeBlock_1XEh"><div class="codeBlockContent_1u-d"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_10dd">Copy</button><div class="prism-code language-jsx codeBlock_3iAC"><div class="codeBlockLines_b7E3" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token keyword" style="color:#c5a5c5">return</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83">&lt;</span><span class="token tag class-name" style="color:#fac863">ScrollView</span><span class="token tag" style="color:#fc929e"> </span><span class="token tag attr-name" style="color:#c5a5c5">contentContainerStyle</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#657b83">=</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript" style="color:#fc929e">styles</span><span class="token tag script language-javascript punctuation" style="color:#657b83">.</span><span class="token tag script language-javascript" style="color:#fc929e">contentContainer</span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag punctuation" style="color:#657b83">&gt;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83">&lt;/</span><span class="token tag class-name" style="color:#fac863">ScrollView</span><span class="token tag punctuation" style="color:#657b83">&gt;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token operator" style="color:#fc929e">...</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token keyword" style="color:#c5a5c5">const</span><span class="token plain"> styles </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"> StyleSheet</span><span class="token punctuation" style="color:#657b83">.</span><span class="token function" style="color:#79b6f2">create</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> contentContainer</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> paddingVertical</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token number" style="color:#5a9bcf">20</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span></div></div></div></div></div><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>StyleSheetPropType(View Style props)</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="contentinset"></a><code>contentInset</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#contentinset" title="Direct link to heading">#</a></h3><p>The amount by which the scroll view content is inset from the edges of the scroll view. Defaults to <code>{top: 0, left: 0, bottom: 0, right: 0}</code>.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>object: {top: number, left: number, bottom: number, right: number}</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="contentinsetadjustmentbehavior"></a><code>contentInsetAdjustmentBehavior</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#contentinsetadjustmentbehavior" title="Direct link to heading">#</a></h3><p>This property specifies how the safe area insets are used to modify the content area of the scroll view. The default value of this property is &quot;never&quot;. Available on iOS 11 and later.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>enum(&#x27;automatic&#x27;, &#x27;scrollableAxes&#x27;, &#x27;never&#x27;, &#x27;always&#x27;)</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="contentoffset"></a><code>contentOffset</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#contentoffset" title="Direct link to heading">#</a></h3><p>Used to manually set the starting scroll offset. The default value is <code>{x: 0, y: 0}</code>.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>PointPropType</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="decelerationrate"></a><code>decelerationRate</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#decelerationrate" title="Direct link to heading">#</a></h3><p>A floating-point number that determines how quickly the scroll view decelerates after the user lifts their finger. You may also use string shortcuts <code>&quot;normal&quot;</code> and <code>&quot;fast&quot;</code> which match the underlying iOS settings for <code>UIScrollViewDecelerationRateNormal</code> and <code>UIScrollViewDecelerationRateFast</code> respectively.</p><ul><li><code>&#x27;normal&#x27;</code> (the default), 0.998 on iOS, 0.985 on Android.</li><li><code>&#x27;fast&#x27;</code>, 0.99 on iOS, 0.9 on Android.</li></ul><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>enum(&#x27;fast&#x27;, &#x27;normal&#x27;), ,number</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="directionallockenabled"></a><code>directionalLockEnabled</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#directionallockenabled" title="Direct link to heading">#</a></h3><p>When true, the ScrollView will try to lock to only vertical or horizontal scrolling while dragging. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="disableintervalmomentum"></a><code>disableIntervalMomentum</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#disableintervalmomentum" title="Direct link to heading">#</a></h3><p>When true, the scroll view stops on the next index (in relation to scroll position at release) regardless of how fast the gesture is. This can be used for horizontal pagination when the page is less than the width of the ScrollView. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="disablescrollviewpanresponder"></a><code>disableScrollViewPanResponder</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#disablescrollviewpanresponder" title="Direct link to heading">#</a></h3><p>When true, the default JS pan responder on the ScrollView is disabled, and full control over touches inside the ScrollView is left to its child components. This is particularly useful if <code>snapToInterval</code> is enabled, since it does not follow typical touch patterns. Do not use this on regular ScrollView use cases without <code>snapToInterval</code> as it may cause unexpected touches to occur while scrolling. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="endfillcolor"></a><code>endFillColor</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#endfillcolor" title="Direct link to heading">#</a></h3><p>Sometimes a scrollview takes up more space than its content fills. When this is the case, this prop will fill the rest of the scrollview with a color to avoid setting a background and creating unnecessary overdraw. This is an advanced optimization that is not needed in the general case.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td><a href="/docs/colors">color</a></td><td>No</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="fadingedgelength"></a><code>fadingEdgeLength</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#fadingedgelength" title="Direct link to heading">#</a></h3><p>Fades out the edges of the the scroll content.</p><p>If the value is greater than 0, the fading edges will be set accordingly to the current scroll direction and position, indicating if there is more content to show.</p><table><thead><tr><th>Type</th><th>Required</th><th>Default</th><th>Platform</th></tr></thead><tbody><tr><td>number</td><td>No</td><td>0</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="horizontal"></a><code>horizontal</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#horizontal" title="Direct link to heading">#</a></h3><p>When true, the scroll view&#x27;s children are arranged horizontally in a row instead of vertically in a column. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="indicatorstyle"></a><code>indicatorStyle</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#indicatorstyle" title="Direct link to heading">#</a></h3><p>The style of the scroll indicators.</p><ul><li><code>&#x27;default&#x27;</code> (the default), same as <code>black</code>.</li><li><code>&#x27;black&#x27;</code>, scroll indicator is <code>black</code>. This style is good against a light background.</li><li><code>&#x27;white&#x27;</code>, scroll indicator is <code>white</code>. This style is good against a dark background.</li></ul><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>enum(&#x27;default&#x27;, &#x27;black&#x27;, &#x27;white&#x27;)</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="invertstickyheaders"></a><code>invertStickyHeaders</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#invertstickyheaders" title="Direct link to heading">#</a></h3><p>If sticky headers should stick at the bottom instead of the top of the ScrollView. This is usually used with inverted ScrollViews.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="keyboarddismissmode"></a><code>keyboardDismissMode</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#keyboarddismissmode" title="Direct link to heading">#</a></h3><p>Determines whether the keyboard gets dismissed in response to a drag.</p><p><em>Cross platform</em></p><ul><li><code>&#x27;none&#x27;</code> (the default), drags do not dismiss the keyboard.</li><li><code>&#x27;on-drag&#x27;</code>, the keyboard is dismissed when a drag begins.</li></ul><p><em>iOS Only</em></p><ul><li><code>&#x27;interactive&#x27;</code>, the keyboard is dismissed interactively with the drag and moves in synchrony with the touch; dragging upwards cancels the dismissal. On android this is not supported and it will have the same behavior as &#x27;none&#x27;.</li></ul><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>enum(&#x27;none&#x27;, &#x27;on-drag&#x27;, &#x27;interactive&#x27;)</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="keyboardshouldpersisttaps"></a><code>keyboardShouldPersistTaps</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#keyboardshouldpersisttaps" title="Direct link to heading">#</a></h3><p>Determines when the keyboard should stay visible after a tap.</p><ul><li><code>&#x27;never&#x27;</code> (the default), tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this happens, children won&#x27;t receive the tap.</li><li><code>&#x27;always&#x27;</code>, the keyboard will not dismiss automatically, and the scroll view will not catch taps, but children of the scroll view can catch taps.</li><li><code>&#x27;handled&#x27;</code>, the keyboard will not dismiss automatically when the tap was handled by children of the scroll view (or captured by an ancestor).</li><li><code>false</code>, <strong><em>deprecated</em></strong>, use &#x27;never&#x27; instead</li><li><code>true</code>, <strong><em>deprecated</em></strong>, use &#x27;always&#x27; instead</li></ul><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>enum(&#x27;always&#x27;, &#x27;never&#x27;, &#x27;handled&#x27;, false, true)</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="maintainvisiblecontentposition"></a><code>maintainVisibleContentPosition</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#maintainvisiblecontentposition" title="Direct link to heading">#</a></h3><p>When set, the scroll view will adjust the scroll position so that the first child that is currently visible and at or beyond <code>minIndexForVisible</code> will not change position. This is useful for lists that are loading content in both directions, e.g. a chat thread, where new messages coming in might otherwise cause the scroll position to jump. A value of 0 is common, but other values such as 1 can be used to skip loading spinners or other content that should not maintain position.</p><p>The optional <code>autoscrollToTopThreshold</code> can be used to make the content automatically scroll to the top after making the adjustment if the user was within the threshold of the top before the adjustment was made. This is also useful for chat-like applications where you want to see new messages scroll into place, but not if the user has scrolled up a ways and it would be disruptive to scroll a bunch.</p><p>Caveat 1: Reordering elements in the scrollview with this enabled will probably cause jumpiness and jank. It can be fixed, but there are currently no plans to do so. For now, don&#x27;t re-order the content of any ScrollViews or Lists that use this feature.</p><p>Caveat 2: This uses <code>contentOffset</code> and <code>frame.origin</code> in native code to compute visibility. Occlusion, transforms, and other complexity won&#x27;t be taken into account as to whether content is &quot;visible&quot; or not.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>object: { minIndexForVisible: number, autoscrollToTopThreshold: number }</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="maximumzoomscale"></a><code>maximumZoomScale</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#maximumzoomscale" title="Direct link to heading">#</a></h3><p>The maximum allowed zoom scale. The default value is 1.0.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>number</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="minimumzoomscale"></a><code>minimumZoomScale</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#minimumzoomscale" title="Direct link to heading">#</a></h3><p>The minimum allowed zoom scale. The default value is 1.0.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>number</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="nestedscrollenabled"></a><code>nestedScrollEnabled</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#nestedscrollenabled" title="Direct link to heading">#</a></h3><p>Enables nested scrolling for Android API level 21+. Nested scrolling is supported by default on iOS.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>Android</td></tr></tbody></table><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="oncontentsizechange"></a><code>onContentSizeChange</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#oncontentsizechange" title="Direct link to heading">#</a></h3><p>Called when scrollable content view of the ScrollView changes.</p><p>Handler function is passed the content width and content height as parameters: <code>(contentWidth, contentHeight)</code></p><p>It&#x27;s implemented using onLayout handler attached to the content container which this ScrollView renders.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="onmomentumscrollbegin"></a><code>onMomentumScrollBegin</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onmomentumscrollbegin" title="Direct link to heading">#</a></h3><p>Called when the momentum scroll starts (scroll which occurs as the ScrollView starts gliding).</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="onmomentumscrollend"></a><code>onMomentumScrollEnd</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onmomentumscrollend" title="Direct link to heading">#</a></h3><p>Called when the momentum scroll ends (scroll which occurs as the ScrollView glides to a stop).</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="onscroll"></a><code>onScroll</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onscroll" title="Direct link to heading">#</a></h3><p>Fires at most once per frame during scrolling. The frequency of the events can be controlled using the <code>scrollEventThrottle</code> prop. The event has the following shape (all values are numbers):</p><div class="mdxCodeBlock_1XEh"><div class="codeBlockContent_1u-d"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_10dd">Copy</button><div class="prism-code language-js codeBlock_3iAC"><div class="codeBlockLines_b7E3" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> nativeEvent</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> contentInset</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain">bottom</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> left</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> right</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> top</span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> contentOffset</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain">x</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> y</span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> contentSize</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain">height</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> width</span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> layoutMeasurement</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain">height</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> width</span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> zoomScale</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span></div></div></div></div></div><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="onscrollbegindrag"></a><code>onScrollBeginDrag</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onscrollbegindrag" title="Direct link to heading">#</a></h3><p>Called when the user begins to drag the scroll view.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="onscrollenddrag"></a><code>onScrollEndDrag</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onscrollenddrag" title="Direct link to heading">#</a></h3><p>Called when the user stops dragging the scroll view and it either stops or begins to glide.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="onscrolltotop"></a><code>onScrollToTop</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onscrolltotop" title="Direct link to heading">#</a></h3><p>Fires when the scroll view scrolls to top after the status bar has been tapped.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>function</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="overscrollmode"></a><code>overScrollMode</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#overscrollmode" title="Direct link to heading">#</a></h3><p>Used to override default value of overScroll mode.</p><p>Possible values:</p><ul><li><code>&#x27;auto&#x27;</code> - Default value, allow a user to over-scroll this view only if the content is large enough to meaningfully scroll.</li><li><code>&#x27;always&#x27;</code> - Always allow a user to over-scroll this view.</li><li><code>&#x27;never&#x27;</code> - Never allow a user to over-scroll this view.</li></ul><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>enum(&#x27;auto&#x27;, &#x27;always&#x27;, &#x27;never&#x27;)</td><td>No</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="pagingenabled"></a><code>pagingEnabled</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#pagingenabled" title="Direct link to heading">#</a></h3><p>When true, the scroll view stops on multiples of the scroll view&#x27;s size when scrolling. This can be used for horizontal pagination. The default value is false.</p><p>Note: Vertical pagination is not supported on Android.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="persistentscrollbar"></a><code>persistentScrollbar</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#persistentscrollbar" title="Direct link to heading">#</a></h3><p>Causes the scrollbars not to turn transparent when they are not in use. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="pinchgestureenabled"></a><code>pinchGestureEnabled</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#pinchgestureenabled" title="Direct link to heading">#</a></h3><p>When true, ScrollView allows use of pinch gestures to zoom in and out. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="refreshcontrol"></a><code>refreshControl</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#refreshcontrol" title="Direct link to heading">#</a></h3><p>A RefreshControl component, used to provide pull-to-refresh functionality for the ScrollView. Only works for vertical ScrollViews (<code>horizontal</code> prop must be <code>false</code>).</p><p>See <a href="/docs/refreshcontrol">RefreshControl</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>element</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="removeclippedsubviews"></a><code>removeClippedSubviews</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#removeclippedsubviews" title="Direct link to heading">#</a></h3><p>Experimental: When true, offscreen child views (whose <code>overflow</code> value is <code>hidden</code>) are removed from their native backing superview when offscreen. This can improve scrolling performance on long lists.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrollbarthumbimage"></a><code>scrollBarThumbImage</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrollbarthumbimage" title="Direct link to heading">#</a></h3><p>Optionally an image can be used for the scroll bar thumb. This will override the color. While the image is loading or the image fails to load the color will be used instead. Use an alpha of 0 in the color to avoid seeing it while the image is loading.</p><ul><li><code>uri</code>, a string representing the resource identifier for the image, which should be either a local file path or the name of a static image resource.</li><li><code>number</code>, opaque type returned by something like <code>import IMAGE from &#x27;./image.jpg&#x27;</code>.</li></ul><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>number</td><td>No</td><td>VR</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrollenabled"></a><code>scrollEnabled</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrollenabled" title="Direct link to heading">#</a></h3><p>When false, the view cannot be scrolled via touch interaction. The default value is true.</p><p>Note that the view can always be scrolled by calling <code>scrollTo</code>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrolleventthrottle"></a><code>scrollEventThrottle</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrolleventthrottle" title="Direct link to heading">#</a></h3><p>This controls how often the scroll event will be fired while scrolling (as a time interval in ms). A lower number yields better accuracy for code that is tracking the scroll position, but can lead to scroll performance problems due to the volume of information being sent over the bridge. You will not notice a difference between values set between 1-16 as the JS run loop is synced to the screen refresh rate. If you do not need precise scroll position tracking, set this value higher to limit the information being sent across the bridge. The default value is zero, which results in the scroll event being sent only once each time the view is scrolled.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>number</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrollindicatorinsets"></a><code>scrollIndicatorInsets</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrollindicatorinsets" title="Direct link to heading">#</a></h3><p>The amount by which the scroll view indicators are inset from the edges of the scroll view. This should normally be set to the same value as the <code>contentInset</code>. Defaults to <code>{0, 0, 0, 0}</code>.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>object: {top: number, left: number, bottom: number, right: number}</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrollperftag"></a><code>scrollPerfTag</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrollperftag" title="Direct link to heading">#</a></h3><p>Tag used to log scroll performance on this scroll view. Will force momentum events to be turned on (see sendMomentumEvents). This doesn&#x27;t do anything out of the box and you need to implement a custom native FpsListener for it to be useful.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>string</td><td>No</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrolltooverflowenabled"></a><code>scrollToOverflowEnabled</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrolltooverflowenabled" title="Direct link to heading">#</a></h3><p>When true, the scroll view can be programmatically scrolled beyond its content size. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrollstotop"></a><code>scrollsToTop</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrollstotop" title="Direct link to heading">#</a></h3><p>When true, the scroll view scrolls to top when the status bar is tapped. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="deprecated_sendupdatedchildframes"></a><code>DEPRECATED_sendUpdatedChildFrames</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#deprecated_sendupdatedchildframes" title="Direct link to heading">#</a></h3><p>When true, ScrollView will emit updateChildFrames data in scroll events, otherwise will not compute or emit child frame data. This only exists to support legacy issues, <code>onLayout</code> should be used instead to retrieve frame data. The default value is false.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="showshorizontalscrollindicator"></a><code>showsHorizontalScrollIndicator</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#showshorizontalscrollindicator" title="Direct link to heading">#</a></h3><p>When true, shows a horizontal scroll indicator. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="showsverticalscrollindicator"></a><code>showsVerticalScrollIndicator</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#showsverticalscrollindicator" title="Direct link to heading">#</a></h3><p>When true, shows a vertical scroll indicator. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="snaptoalignment"></a><code>snapToAlignment</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#snaptoalignment" title="Direct link to heading">#</a></h3><p>When <code>snapToInterval</code> is set, <code>snapToAlignment</code> will define the relationship of the snapping to the scroll view.</p><ul><li><code>&#x27;start&#x27;</code> (the default) will align the snap at the left (horizontal) or top (vertical).</li><li><code>&#x27;center&#x27;</code> will align the snap in the center.</li><li><code>&#x27;end&#x27;</code> will align the snap at the right (horizontal) or bottom (vertical).</li></ul><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>enum(&#x27;start&#x27;, &#x27;center&#x27;, &#x27;end&#x27;)</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="snaptoend"></a><code>snapToEnd</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#snaptoend" title="Direct link to heading">#</a></h3><p>Use in conjunction with <code>snapToOffsets</code>. By default, the end of the list counts as a snap offset. Set <code>snapToEnd</code> to false to disable this behavior and allow the list to scroll freely between its end and the last <code>snapToOffsets</code> offset. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>boolean</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="snaptointerval"></a><code>snapToInterval</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#snaptointerval" title="Direct link to heading">#</a></h3><p>When set, causes the scroll view to stop at multiples of the value of <code>snapToInterval</code>. This can be used for paginating through children that have lengths smaller than the scroll view. Typically used in combination with <code>snapToAlignment</code> and <code>decelerationRate=&quot;fast&quot;</code>. Overrides less configurable <code>pagingEnabled</code> prop.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>number</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="snaptooffsets"></a><code>snapToOffsets</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#snaptooffsets" title="Direct link to heading">#</a></h3><p>When set, causes the scroll view to stop at the defined offsets. This can be used for paginating through variously sized children that have lengths smaller than the scroll view. Typically used in combination with <code>decelerationRate=&quot;fast&quot;</code>. Overrides less configurable <code>pagingEnabled</code> and <code>snapToInterval</code> props.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>array of number</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="snaptostart"></a><code>snapToStart</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#snaptostart" title="Direct link to heading">#</a></h3><p>Use in conjunction with <code>snapToOffsets</code>. By default, the beginning of the list counts as a snap offset. Set <code>snapToStart</code> to false to disable this behavior and allow the list to scroll freely between its start and the first <code>snapToOffsets</code> offset. The default value is true.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>boolean</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="stickyheaderindices"></a><code>stickyHeaderIndices</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#stickyheaderindices" title="Direct link to heading">#</a></h3><p>An array of child indices determining which children get docked to the top of the screen when scrolling. For example, passing <code>stickyHeaderIndices={[0]}</code> will cause the first child to be fixed to the top of the scroll view. This property is not supported in conjunction with <code>horizontal={true}</code>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>array of number</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="zoomscale"></a><code>zoomScale</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#zoomscale" title="Direct link to heading">#</a></h3><p>The current scale of the scroll view content. The default value is 1.0.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>number</td><td>No</td><td>iOS</td></tr></tbody></table><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="methods"></a>Methods<a aria-hidden="true" tabindex="-1" class="hash-link" href="#methods" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="flashscrollindicators"></a><code>flashScrollIndicators()</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#flashscrollindicators" title="Direct link to heading">#</a></h3><div class="mdxCodeBlock_1XEh"><div class="codeBlockContent_1u-d"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_10dd">Copy</button><div class="prism-code language-jsx codeBlock_3iAC"><div class="codeBlockLines_b7E3" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token function" style="color:#79b6f2">flashScrollIndicators</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span></div></div></div></div></div><p>Displays the scroll indicators momentarily.</p><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrollto"></a><code>scrollTo()</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrollto" title="Direct link to heading">#</a></h3><div class="mdxCodeBlock_1XEh"><div class="codeBlockContent_1u-d"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_10dd">Copy</button><div class="prism-code language-jsx codeBlock_3iAC"><div class="codeBlockLines_b7E3" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token function" style="color:#79b6f2">scrollTo</span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> options</span><span class="token operator" style="color:#fc929e">?</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain">x</span><span class="token operator" style="color:#fc929e">?</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> number</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> y</span><span class="token operator" style="color:#fc929e">?</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> number</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> animated</span><span class="token operator" style="color:#fc929e">?</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> boolean</span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"> </span><span class="token operator" style="color:#fc929e">|</span><span class="token plain"> number</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> deprecatedX</span><span class="token operator" style="color:#fc929e">?</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> number</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> deprecatedAnimated</span><span class="token operator" style="color:#fc929e">?</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> boolean</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span></div></div></div></div></div><p>Scrolls to a given x, y offset, either immediately, with a smooth animation.</p><p>Example:</p><p><code>scrollTo({x: 0, y: 0, animated: true})</code></p><p>Note: The weird function signature is due to the fact that, for historical reasons, the function also accepts separate arguments as an alternative to the options object. This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.</p><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrolltoend"></a><code>scrollToEnd()</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrolltoend" title="Direct link to heading">#</a></h3><div class="mdxCodeBlock_1XEh"><div class="codeBlockContent_1u-d"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_10dd">Copy</button><div class="prism-code language-jsx codeBlock_3iAC"><div class="codeBlockLines_b7E3" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token function" style="color:#79b6f2">scrollToEnd</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">[</span><span class="token plain">options</span><span class="token punctuation" style="color:#657b83">]</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"> animated</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> boolean</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> duration</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> number </span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span></div></div></div></div></div><p>If this is a vertical ScrollView scrolls to the bottom. If this is a horizontal ScrollView scrolls to the right.</p><p>Use <code>scrollToEnd({animated: true})</code> for smooth animated scrolling, <code>scrollToEnd({animated: false})</code> for immediate scrolling. For Android, you may specify a duration, e.g. <code>scrollToEnd({duration: 500})</code> for a controlled duration scroll. If no options are passed, <code>animated</code> defaults to true.</p><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2cZh" id="scrollwithoutanimationto"></a><code>scrollWithoutAnimationTo()</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#scrollwithoutanimationto" title="Direct link to heading">#</a></h3><div class="mdxCodeBlock_1XEh"><div class="codeBlockContent_1u-d"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_10dd">Copy</button><div class="prism-code language-jsx codeBlock_3iAC"><div class="codeBlockLines_b7E3" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token function" style="color:#79b6f2">scrollWithoutAnimationTo</span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain">y</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> x</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span></div></div></div></div></div><p>Deprecated, use <code>scrollTo</code> instead.</p></div></article><div class="docMetadata margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/facebook/react-native-website/blob/master/website/versioned_docs/version-0.63/scrollview.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small class="docMetadata-updated">Last updated on <time datetime="2020-10-29T04:19:29.000Z" class="docLastUpdatedAt_1gIo">10/29/2020</time></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Blog list page navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/docs/refreshcontrol"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« RefreshControl</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/docs/sectionlist"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">SectionList »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_3SO_"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#example" class="table-of-contents__link">Example</a></li><li><a href="#props" class="table-of-contents__link">Props</a><ul><li><a href="#alwaysbouncehorizontal" class="table-of-contents__link"><code>alwaysBounceHorizontal</code></a></li><li><a href="#alwaysbouncevertical" class="table-of-contents__link"><code>alwaysBounceVertical</code></a></li><li><a href="#automaticallyadjustcontentinsets" class="table-of-contents__link"><code>automaticallyAdjustContentInsets</code></a></li><li><a href="#bounces" class="table-of-contents__link"><code>bounces</code></a></li><li><a href="#bounceszoom" class="table-of-contents__link"><code>bouncesZoom</code></a></li><li><a href="#cancancelcontenttouches" class="table-of-contents__link"><code>canCancelContentTouches</code></a></li><li><a href="#centercontent" class="table-of-contents__link"><code>centerContent</code></a></li><li><a href="#contentcontainerstyle" class="table-of-contents__link"><code>contentContainerStyle</code></a></li><li><a href="#contentinset" class="table-of-contents__link"><code>contentInset</code></a></li><li><a href="#contentinsetadjustmentbehavior" class="table-of-contents__link"><code>contentInsetAdjustmentBehavior</code></a></li><li><a href="#contentoffset" class="table-of-contents__link"><code>contentOffset</code></a></li><li><a href="#decelerationrate" class="table-of-contents__link"><code>decelerationRate</code></a></li><li><a href="#directionallockenabled" class="table-of-contents__link"><code>directionalLockEnabled</code></a></li><li><a href="#disableintervalmomentum" class="table-of-contents__link"><code>disableIntervalMomentum</code></a></li><li><a href="#disablescrollviewpanresponder" class="table-of-contents__link"><code>disableScrollViewPanResponder</code></a></li><li><a href="#endfillcolor" class="table-of-contents__link"><code>endFillColor</code></a></li><li><a href="#fadingedgelength" class="table-of-contents__link"><code>fadingEdgeLength</code></a></li><li><a href="#horizontal" class="table-of-contents__link"><code>horizontal</code></a></li><li><a href="#indicatorstyle" class="table-of-contents__link"><code>indicatorStyle</code></a></li><li><a href="#invertstickyheaders" class="table-of-contents__link"><code>invertStickyHeaders</code></a></li><li><a href="#keyboarddismissmode" class="table-of-contents__link"><code>keyboardDismissMode</code></a></li><li><a href="#keyboardshouldpersisttaps" class="table-of-contents__link"><code>keyboardShouldPersistTaps</code></a></li><li><a href="#maintainvisiblecontentposition" class="table-of-contents__link"><code>maintainVisibleContentPosition</code></a></li><li><a href="#maximumzoomscale" class="table-of-contents__link"><code>maximumZoomScale</code></a></li><li><a href="#minimumzoomscale" class="table-of-contents__link"><code>minimumZoomScale</code></a></li><li><a href="#nestedscrollenabled" class="table-of-contents__link"><code>nestedScrollEnabled</code></a></li><li><a href="#oncontentsizechange" class="table-of-contents__link"><code>onContentSizeChange</code></a></li><li><a href="#onmomentumscrollbegin" class="table-of-contents__link"><code>onMomentumScrollBegin</code></a></li><li><a href="#onmomentumscrollend" class="table-of-contents__link"><code>onMomentumScrollEnd</code></a></li><li><a href="#onscroll" class="table-of-contents__link"><code>onScroll</code></a></li><li><a href="#onscrollbegindrag" class="table-of-contents__link"><code>onScrollBeginDrag</code></a></li><li><a href="#onscrollenddrag" class="table-of-contents__link"><code>onScrollEndDrag</code></a></li><li><a href="#onscrolltotop" class="table-of-contents__link"><code>onScrollToTop</code></a></li><li><a href="#overscrollmode" class="table-of-contents__link"><code>overScrollMode</code></a></li><li><a href="#pagingenabled" class="table-of-contents__link"><code>pagingEnabled</code></a></li><li><a href="#persistentscrollbar" class="table-of-contents__link"><code>persistentScrollbar</code></a></li><li><a href="#pinchgestureenabled" class="table-of-contents__link"><code>pinchGestureEnabled</code></a></li><li><a href="#refreshcontrol" class="table-of-contents__link"><code>refreshControl</code></a></li><li><a href="#removeclippedsubviews" class="table-of-contents__link"><code>removeClippedSubviews</code></a></li><li><a href="#scrollbarthumbimage" class="table-of-contents__link"><code>scrollBarThumbImage</code></a></li><li><a href="#scrollenabled" class="table-of-contents__link"><code>scrollEnabled</code></a></li><li><a href="#scrolleventthrottle" class="table-of-contents__link"><code>scrollEventThrottle</code></a></li><li><a href="#scrollindicatorinsets" class="table-of-contents__link"><code>scrollIndicatorInsets</code></a></li><li><a href="#scrollperftag" class="table-of-contents__link"><code>scrollPerfTag</code></a></li><li><a href="#scrolltooverflowenabled" class="table-of-contents__link"><code>scrollToOverflowEnabled</code></a></li><li><a href="#scrollstotop" class="table-of-contents__link"><code>scrollsToTop</code></a></li><li><a href="#deprecated_sendupdatedchildframes" class="table-of-contents__link"><code>DEPRECATED_sendUpdatedChildFrames</code></a></li><li><a href="#showshorizontalscrollindicator" class="table-of-contents__link"><code>showsHorizontalScrollIndicator</code></a></li><li><a href="#showsverticalscrollindicator" class="table-of-contents__link"><code>showsVerticalScrollIndicator</code></a></li><li><a href="#snaptoalignment" class="table-of-contents__link"><code>snapToAlignment</code></a></li><li><a href="#snaptoend" class="table-of-contents__link"><code>snapToEnd</code></a></li><li><a href="#snaptointerval" class="table-of-contents__link"><code>snapToInterval</code></a></li><li><a href="#snaptooffsets" class="table-of-contents__link"><code>snapToOffsets</code></a></li><li><a href="#snaptostart" class="table-of-contents__link"><code>snapToStart</code></a></li><li><a href="#stickyheaderindices" class="table-of-contents__link"><code>stickyHeaderIndices</code></a></li><li><a href="#zoomscale" class="table-of-contents__link"><code>zoomScale</code></a></li></ul></li><li><a href="#methods" class="table-of-contents__link">Methods</a><ul><li><a href="#flashscrollindicators" class="table-of-contents__link"><code>flashScrollIndicators()</code></a></li><li><a href="#scrollto" class="table-of-contents__link"><code>scrollTo()</code></a></li><li><a href="#scrolltoend" class="table-of-contents__link"><code>scrollToEnd()</code></a></li><li><a href="#scrollwithoutanimationto" class="table-of-contents__link"><code>scrollWithoutAnimationTo()</code></a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/tutorial">Tutorial</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/components-and-apis">Components and APIs</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/more-resources">More Resources</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/help">The React Native Community</a></li><li class="footer__item"><a class="footer__link-item" href="/showcase">Who&#x27;s using React Native?</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">Ask Questions on Stack Overflow</a></li><li class="footer__item"><a href="https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer" class="footer__link-item">Contributor Guide</a></li><li class="footer__item"><a href="https://dev.to/t/reactnative" target="_blank" rel="noopener noreferrer" class="footer__link-item">DEV Community</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">More Resources</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/blog">Blog</a></li><li class="footer__item"><a href="https://twitter.com/reactnative" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://reactjs.org/" target="_blank" rel="noopener noreferrer" class="footer__link-item">React</a></li></ul></div></div><div class="text--center"><div class="margin-bottom--sm"><a href="https://opensource.facebook.com" target="_blank" rel="noopener noreferrer" class="footerLogoLink_1zJy"><img class="footer__logo" alt="Facebook Open Source Logo" src="/img/oss_logo.png"></a></div><div>Copyright © 2020 Facebook, Inc.</div></div></div></footer></div>
<script src="/styles.473a8a2f.js"></script>
<script src="/runtime~main.7f7b2f9b.js"></script>
<script src="/main.cfaa289e.js"></script>
<script src="/1.b8ab3a64.js"></script>
<script src="/2.728a4992.js"></script>
<script src="/1f391b9e.0c09adb2.js"></script>
<script src="/940.3ab6ef7d.js"></script>
<script src="/ee5b3385.81eddc93.js"></script>
<script src="/17896441.ca368bf1.js"></script>
<script src="/f9b8463d.e4a0a711.js"></script>
</body>
</html>