File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ However, there are few more additional props:
27
27
28
28
| Prop| Description| Platform|
29
29
| -| :-----:| :---:|
30
+ |` style: object ` |Style to apply to ViewPager|both
30
31
|` pageMargin: number ` |Blank space to be shown between pages|both
31
32
|` orientation: Orientation ` |Set ` horizontal ` or ` vertical ` scrolling orientation (it does ** not** work dynamically)|both
32
33
|` transitionStyle: TransitionStyle ` |Use ` scroll ` or ` curl ` to change transition style (it does ** not** work dynamically)|iOS
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
- import { Keyboard } from 'react-native' ;
2
+ import { Keyboard , StyleProp } from 'react-native' ;
3
3
import ViewPager from '@react-native-community/viewpager' ;
4
4
import Animated from 'react-native-reanimated' ;
5
5
@@ -29,6 +29,7 @@ type Props<T extends Route> = PagerCommonProps & {
29
29
jumpTo : ( key : string ) => void ;
30
30
}
31
31
) => React . ReactNode ;
32
+ style ?: StyleProp < ViewStyle > ;
32
33
orientation ?: 'vertical' | 'horizontal' ;
33
34
transitionStyle ?: 'scroll' | 'curl' ;
34
35
showPageIndicator ?: boolean ;
@@ -148,6 +149,7 @@ export default class ViewPagerBackend<T extends Route> extends React.Component<
148
149
149
150
render ( ) {
150
151
const {
152
+ style,
151
153
keyboardDismissMode,
152
154
swipeEnabled,
153
155
children,
@@ -166,7 +168,7 @@ export default class ViewPagerBackend<T extends Route> extends React.Component<
166
168
< AnimatedViewPager
167
169
ref = { this . ref }
168
170
lazy = { false }
169
- style = { { flex : 1 } }
171
+ style = { { flex : 1 , ... style } }
170
172
initialPage = { this . props . navigationState . index }
171
173
keyboardDismissMode = {
172
174
// ViewPager does not accept auto mode
You can’t perform that action at this time.
0 commit comments