react-native-swiper in android screen rotate from potrait to landscape, the scroll is not rerender

393 Views Asked by At

react-native-swiper issue

  1. swiper width and height are resized after screen rotation(using Dimensions.get('window').width, and height,

  2. but the scroll is not Re_render, it shows the portions of previous slide along with active slide

          <Swiper width={screenData.width} height={screenData.height}>
        <View style={[styles.slide, {backgroundColor: '#fa931d'}]}>
          <View level={10}>
            <Text style={styles.text}>Page 1</Text>
          </View>
        </View>
        <View style={[styles.slide, {backgroundColor: '#a4b602'}]}>
          <View level={-10}>
            <Text style={styles.text}>Page 2</Text>
          </View>
        </View>
        <View style={[styles.slide, {backgroundColor: '#fa931d'}]}>
          <View level={8}>
            <Text style={styles.text}>Page 3</Text>
          </View>
        </View>
        <View style={[styles.slide, {backgroundColor: '#a4b602'}]}>
          <View level={5}>
            <Text style={styles.text}>Page 4</Text>
          </View>
        </View>
      </Swiper>
    
0

There are 0 best solutions below