Reputation: 342
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 :
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 ?
Upvotes: 1
Views: 1064
Reputation: 1672
ViewPager does not support this kind of feature. See https://github.com/react-native-community/react-native-viewpager/issues/37
Upvotes: 0