react-native-looped-carousel
react-native-looped-carousel copied to clipboard
animateToPage and _animatePreviousPage not working in ScrollView
animateToPage and _animatePreviousPage not working in ScrollView in iPhone 6Plus and iPhone 7.
<Carousel
delay = {2000}
style = {this.state.size}
autoplay = {false}
isLooped = {false}
pageInfo = {false}
bullets = {true}
bulletStyle = {{backgroundColor:'#BFBFBF', borderWidth:0}}
chosenBulletStyle = {{backgroundColor:'#717171', borderWidth:0}}
onAnimateNextPage = {(p) => console.log(p)}
currentPage = {this.state.currentPageNo}
ref = {(ref) => { this._carousel = ref; }}>
<View style={[{ backgroundColor: '#BADA55', paddingTop:50 }, this.state.size]}>
<Text>1</Text><Text onPress={() => {this._carousel._animateNextPage()}}>onpress</Text>
</View>
<View style={[{ backgroundColor: 'red', paddingTop:50 }, this.state.size]}>
<Text>22</Text><Text onPress={() => {this._carousel._animatePreviousPage()}}>onpress-Prev</Text>
<ScrollView style={{flex:1, backgroundColor: 'yellow'}}>
<Text>21</Text><Text onPress={() => {this._carousel._animatePreviousPage()}}>onpress-in-between</Text>
</ScrollView>
</View>
<View style={[{ backgroundColor: 'blue', paddingTop:50 }, this.state.size]}>
<Text>3</Text><Text onPress={() => {this._carousel.animateToPage(0)}}>onpress</Text>
</View>
</Carousel>
When we put page content in between ScrollView and call that function from there then the function is not working in the release build, but in debug build it's working fine.
Can anyone please suggest any solution how to solve the problem?? We need it urgently because we are implementing it in the live project.
Is there any solution for above problem? We are stuck here for that issue. Need any solution.