react-swipeable-views icon indicating copy to clipboard operation
react-swipeable-views copied to clipboard

native version's SwipeableViews's style not right

Open geminiyellow opened this issue 7 years ago • 0 comments
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:

image

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

image

ok, there is a View who paddingLeft 50 in the SwipeableViews.

how to implement the DemoCoverflow in native ?

geminiyellow avatar Sep 13 '18 08:09 geminiyellow