zbtang/React-Native-ViewPager

React-Native-ViewPager inside StackNavigator

Closed this issue ยท 1 comments

I'm using React-Native-ViewPager with ReactNavigation and I wrapped my component inside a StackNavigator. Everything is fine but when I'm trying to scroll back on iOS if I'm on other pages than first page, the previous page appears on behind the component. here is my dependencies

"react": "16.3.1",
"react-native": "0.55.4",
"rn-viewpager": "^1.2.9"
"react-navigation": "^2.0.1",

and here is my JSX code

<View style={{flex: 1}}>
    <IndicatorViewPager
        style={{
            removeClippedSubviews: 'false',
            flex: 1,
            flexDirection: 'column-reverse',
            backgroundColor: 'white',
            width: Dimensions.get('window').width,
        }}
        removeClippedSubviews={false}
        indicator={this._renderTabIndicator()}>
        <View style={{overflow: 'hidden', backgroundColor: 'cadetblue'}}>
            <Text>page one</Text>
        </View>
        <View style={{overflow: 'hidden', backgroundColor: 'cornflowerblue'}}>
            <Text>page two</Text>
        </View>
        <View style={{overflow: 'hidden', backgroundColor: '#1AA094'}}>
            <Text>page three</Text>
        </View>
    </IndicatorViewPager>
</View>

How can I fix it?
screen shot 2018-06-06 at 13 54 40
screen shot 2018-06-06 at 13 54 48

try this style at your container: {overflow: "hidden"}