React-native-swiper: White screen after switch tabs

Created on 25 Dec 2017  路  6Comments  路  Source: leecade/react-native-swiper

os:
iOS

version:

  • react-native-swiper v1.5.13
  • react-native v0.48.3

When react-native-swiper used with tab navigatiotr (react-navigation), after switch to other tabs a few time and switch back, the swiper turns out a white screen.

It is a problem only on iOS, while it works well on Android. I found if I set "removeClippedSubviews: false" in index.js of react-native-swiper, the problem seems solved. However I have not done further test yet.

Most helpful comment

set this attribute on swiper removeClippedSubviews={false}

you should not use this attribute for large listViews.

All 6 comments

os:
win 10 x64

version:

  • react-native-swiper v1.5.13
  • react-native v0.50.4

Hello, I have same issue on physical android device while Remote JS Debug is enabled . I have found that this issue is related to styles.

For example:

var stylesForSwipper = StyleSheet.create({
    wrapper: {},
    slide1: {
        flex: 1,
        backgroundColor: '#9DD6EB',
    },
    slide2: {
        flex: 1,
        backgroundColor: '#97CAE5',
    },
})

And here is render() method:

<Swiper style={stylesForSwipper.wrapper} showsButtons={true}>
   <View style={stylesForSwipper.slide1}>
      ...
   </View>
   <View style={stylesForSwipper.slide2}>
      ...
   </View>
</Swiper>

This leads to white screen but navigation buttons are visible.

This issue occurs for me only if Remote JS Debug is enabled.

@saigyouyou same here I am also seeing the white screen.

by replacing line https://github.com/leecade/react-native-swiper/blob/master/src/index.js#L630
with contentOffset={{ x: 0, y: 0}} I was able to fix the issue.
Looks like there is something wrong with the offsetting in iOS.

@leecade @arribbar Any idea what could be the issue?

set this attribute on swiper removeClippedSubviews={false}

you should not use this attribute for large listViews.

@borvelt removeClippedSubviews={false} work for me

@borvelt removeClippedSubviews={false} work for me, thank you

@borvelt wrok for me too, thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tokict picture tokict  路  3Comments

nicolabortignon picture nicolabortignon  路  3Comments

AndrewSouthpaw picture AndrewSouthpaw  路  3Comments

hadrienbbt picture hadrienbbt  路  3Comments

ghost picture ghost  路  3Comments