race604 / react-native-viewpager

[Deprecated] ViewPager component for React Native
1.41k stars 373 forks source link

Can not customize the width, when the specified width, the two sides will be more of a painting! I hope the author can give a solution. Thanks to the author's library! #151

Open HAPENLY opened 7 years ago

HAPENLY commented 7 years ago

image When I give the picture to the width of the time, twice will show the candidate picture. Tried a lot of ways can not be resolved, I hope the author concerned about this issue, so that the library better use. Thanks to the author's library!

clarete commented 7 years ago

Not sure if that helps but I wasn't successful controlling the width of the <ViewPager> either. I ended up wrapping it around a regular <View> and it worked exactly like I expected. HTH.

jslz commented 6 years ago

@clarete what do you mean, how do you put a View as a child of ViewPager to force the width?

clarete commented 6 years ago

Hi @jslz I just put the ViewPager element within a View and set the width of the View.

   <View style={{ width: Dimensions.get('window').width }} ref="viewPager">
      <ViewPager (...) />
   </View>