1

I'm using the react native viewPager from react native community : https://github.com/react-native-community/react-native-viewpager

And I would like to render something like the logo displayed on the main page :

enter image description here

But it looks like the childrens item of the viewPager must be stretch, So we can't see the part of the second children.

I tried to set a fixed width on the childrens component, but it doesn't works :

<ViewPager
            style={{
                height: 100
            }}
            pageMargin={5}
            initialPage={userPosition}
        >
            <View style={{width: 80, height: 100, borderColor: "green", borderWidth: 1}}/>
            <View style={{width: 80, height: 100, borderColor: "green", borderWidth: 1}}/>
            <View style={{width: 80, height: 100, borderColor: "green", borderWidth: 1}}/>
        </ViewPager>

There is a solution for this problem keeping that library ? Or should I take a look on a carousel library ?

Toto NaBendo
  • 290
  • 3
  • 26

1 Answers1

0

ViewPager does not support this kind of feature. See https://github.com/react-native-community/react-native-viewpager/issues/37

Piotr Badura
  • 1,574
  • 1
  • 13
  • 17