react-swipeable-views
react-swipeable-views copied to clipboard
native version's SwipeableViews's style not right
trafficstars
hi, @oliviertassinari thanks for your great work.
copy some code from the example DemoCoverflow,
const styles = StyleSheet.create({
container: {
flex: 1,
},
slide: {
backgroundColor: 'yellow',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
flex: 1,
paddingVertical: 24,
paddingHorizontal: 16,
},
img: {
height: 180,
width: 180,
backgroundColor: theme.blue,
marginBottom: 16,
},
});
<SwipeableViews
style={styles.container}
index={index}
onChangeIndex={this.handleChangeIndex}
onSwitching={this.handleSwitch}
>
<Animated.View
style={styles.slide}
>
<Card style={styles.img} />
</Animated.View>
</SwipeableViews>
ok, the layout looks like this:

and, if i add the padding to SwipeableViews 's styles,
- style={{ backgroundColor: 'red', flex: 1 }}
+ style={{ backgroundColor: 'red', flex: 1, paddingHorizontal: 50 }}
the layout will change to

ok, there is a View who paddingLeft 50 in the SwipeableViews.
how to implement the DemoCoverflow in native ?