machadogj / react-native-carousel-control

React Native Carousel control with support for iOS and Android
MIT License
247 stars 55 forks source link

Carousel is not working in android - form last commit #7

Closed karthickvkumar closed 8 years ago

karthickvkumar commented 8 years ago

Hi @machadogj, Recently i post a issue regarding initialPage props not working. After that you did a commit but now, Carousel is not working on Android, It simply scrolls like Horizontal scroll view. I even checked with v0.27 in android. still, im getting the same result.

d14w3j

Thanks in Advance!

machadogj commented 8 years ago

Hi @karthickvkumar, I tried with the latest and the following code seems to be working as expected:

          <Text style={styles.welcome}>
            Welcome to React Native!
          </Text>
          <Text style={styles.instructions}>
            See carousel below.
          </Text>
          <Carousel initialPage={1} pageStyle={ {backgroundColor: 'grey', padding: 20, height: 120} }>
              <Text>Hello</Text>
              <Text>World!</Text>
              <Text>From carousel</Text>
          </Carousel>

I'll keep doing some more testing, but let me know if that works for you.

karthickvkumar commented 8 years ago

@machadogj after wrapping <Carousel>...<Carousel> inside <View> with flex:1, its working fine! but its not setting the initialPage, Can you please put your working example for reference!

machadogj commented 8 years ago

@karthickvkumar what I pasted in my previous comment seems to be working on android. Which version of react-native-carousel-control do you have in your node_modules folder?

machadogj commented 8 years ago

@karthickvkumar turns out you were right on the initialPage bug. Don't know why it worked for me, but it should be fixed in version 1.0.3 (https://github.com/machadogj/react-native-carousel-control/commit/fc864259cfe81a1409ba985c877c4b206abde822). Thanks for reporting it!