1
1
/* @flow */
2
2
3
3
import React , { PureComponent } from 'react' ;
4
- import { View , StyleSheet } from 'react-native' ;
4
+ import { View , StyleSheet , Platform } from 'react-native' ;
5
5
import { TabViewAnimated , TabViewPagerPan } from 'react-native-tab-view' ;
6
6
import type { Layout } from 'react-native-tab-view/src/TabViewTypeDefinitions' ;
7
7
import SceneView from '../SceneView' ;
@@ -20,6 +20,7 @@ export type TabViewConfig = {
20
20
tabBarComponent ?: ReactClass < * > ,
21
21
tabBarPosition ?: 'top' | 'bottom' ,
22
22
tabBarOptions ?: { } ,
23
+ initialLayout ?: { width : number , height : number } ,
23
24
swipeEnabled ?: boolean ,
24
25
animationEnabled ?: boolean ,
25
26
lazy ?: boolean ,
@@ -37,6 +38,7 @@ type Props = {
37
38
tabBarComponent ?: ReactClass < * > ,
38
39
tabBarPosition ?: 'top' | 'bottom' ,
39
40
tabBarOptions ?: { } ,
41
+ initialLayout ?: { width : number , height : number } ,
40
42
swipeEnabled ?: boolean ,
41
43
animationEnabled ?: boolean ,
42
44
lazy ?: boolean ,
@@ -206,6 +208,9 @@ class TabView extends PureComponent<void, Props, void> {
206
208
screenProps : this . props . screenProps ,
207
209
style : styles . container ,
208
210
} ;
211
+ if ( Platform . OS === 'android' ) {
212
+ props . initialLayout = { width : 1 , height : 0 } ;
213
+ }
209
214
210
215
return < TabViewAnimated { ...props } /> ;
211
216
}
0 commit comments