You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-34Lines changed: 39 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ This component allows the user to swipe left and right through pages of data. Un
16
16
17
17
## Versions
18
18
19
-
| 4.x | 5.x
20
-
|------------- | -------------|
21
-
| iOS | iOS support |
22
-
| ViewPager1 | ViewPager2 |
23
-
19
+
| 4.x | 5.x |
20
+
| ---------- | ----------- |
21
+
| iOS | iOS support |
22
+
| ViewPager1 | ViewPager2 |
24
23
25
24
## Migration
26
25
27
-
`"@react-native-community/viewpager"` library has been changed to `react-native-pager-view`. Here you can find more information, how to migrate pager view to the latest [version](https://github.com/callstack/react-native-pager-view/blob/master/MIGRATION.md)
26
+
`"@react-native-community/viewpager"` library has been changed to `react-native-pager-view`. Here you can find more information, how to migrate pager view to the latest [version](https://github.com/callstack/react-native-pager-view/blob/master/MIGRATION.md)
**Attention:** Note that you can only use `View` components as children of `PagerView` (cf. folder */example*)
125
-
. For Android if `View` has own children, set prop `collapsable` to false <https://reactnative.dev/img/view#collapsable>, otherwise react-native might remove those children views and and it's children will be rendered as separate pages
124
+
**Attention:** Note that you can only use `View` components as children of `PagerView` (cf. folder _/example_)
125
+
. For Android if `View` has own children, set prop `collapsable` to false <https://reactnative.dev/img/view#collapsable>, otherwise react-native might remove those children views and and it's children will be rendered as separate pages
126
126
127
127
## Advanced usage
128
128
@@ -131,21 +131,27 @@ For advanced usage please take a look into our [example project](https://github.
131
131
132
132
## API
133
133
134
-
|Prop|Description|Platform|
135
-
|-|:-----:|:---:|
136
-
|`initialPage`|Index of initial page that should be selected|both
137
-
|`scrollEnabled: boolean`|Should pager view scroll, when scroll enabled|both
138
-
|`onPageScroll: (e: PageScrollEvent) => void`|Executed when transitioning between pages (ether because the animation for the requested page has changed or when the user is swiping/dragging between pages)|both
139
-
|`onPageScrollStateChanged: (e: PageScrollStateChangedEvent) => void`|Function called when the page scrolling state has changed|both
140
-
|`onPageSelected: (e: PageSelectedEvent) => void`|This callback will be called once the ViewPager finishes navigating to the selected page|both
141
-
|`pageMargin: number`|Blank space to be shown between pages|both
142
-
|`keyboardDismissMode: ('none' / 'on-drag')`| Determines whether the keyboard gets dismissed in response to a drag|both
143
-
|`orientation: Orientation`|Set `horizontal` or `vertical` scrolling orientation (it does **not** work dynamically)|both
144
-
|`transitionStyle: TransitionStyle`|Use `scroll` or `curl` to change transition style (it does **not** work dynamically)|iOS
145
-
|`showPageIndicator: boolean`|Shows the dots indicator at the bottom of the view|iOS
146
-
|`overScrollMode: OverScollMode`|Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto`|Android
147
-
|`offscreenPageLimit: number`|Set the number of pages that should be retained to either side of the currently visible page(s). Pages beyond this limit will be recreated from the adapter when needed. Defaults to RecyclerView's caching strategy. The given value must either be larger than 0.|Android
148
-
|`overdrag: boolean`|Allows for overscrolling after reaching the end or very beginning or pages|iOS
|`initialPage`| Index of initial page that should be selected | both |
137
+
|`scrollEnabled: boolean`| Should pager view scroll, when scroll enabled | both |
138
+
|`onPageScroll: (e: PageScrollEvent) => void`| Executed when transitioning between pages (ether because the animation for the requested page has changed or when the user is swiping/dragging between pages) | both |
139
+
|`onPageScrollStateChanged: (e: PageScrollStateChangedEvent) => void`| Function called when the page scrolling state has changed | both |
140
+
|`onPageSelected: (e: PageSelectedEvent) => void`| This callback will be called once the ViewPager finishes navigating to the selected page | both |
141
+
|`pageMargin: number`| Blank space to be shown between pages | both |
142
+
|`keyboardDismissMode: ('none' / 'on-drag')`| Determines whether the keyboard gets dismissed in response to a drag | both |
143
+
|`orientation: Orientation`| Set `horizontal` or `vertical` scrolling orientation (it does **not** work dynamically) | both |
144
+
|`transitionStyle: TransitionStyle`| Use `scroll` or `curl` to change transition style (it does **not** work dynamically) | iOS |
145
+
|`showPageIndicator: boolean`| Shows the dots indicator at the bottom of the view | iOS |
146
+
|`overScrollMode: OverScollMode`| Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto`| Android |
147
+
|`offscreenPageLimit: number`| Set the number of pages that should be retained to either side of the currently visible page(s). Pages beyond this limit will be recreated from the adapter when needed. Defaults to RecyclerView's caching strategy. The given value must either be larger than 0. | Android |
148
+
|`overdrag: boolean`| Allows for overscrolling after reaching the end or very beginning or pages | iOS |
|`setPage(index: number)`| Function to scroll to a specific page in the PagerView. Invalid index is ignored. | both |
153
+
|`setPageWithoutAnimation(index: number)`| Function to scroll to a specific page in the PagerView. Invalid index is ignored. | both |
154
+
|`setScrollEnabled(scrollEnabled: boolean)`| A helper function to enable/disable scroll imperatively. The recommended way is using the scrollEnabled prop, however, there might be a case where a imperative solution is more useful (e.g. for not blocking an animation) | both |
0 commit comments