React-native-swiper: Until the first swipe the first slide doesn't show up

Created on 18 May 2017  ·  20Comments  ·  Source: leecade/react-native-swiper

I have build a simple swiper in android where 5 slides are supposed to be shown. On load I can see 5 dots below with the first dot being active but the content is not shown for the same.

Here is my code:

<ScrollView>
        <Swiper
          height={deviceHeight - 200}
          paginationStyle={{ bottom: 20 }}
          activeDot={<View style={mainStyles.sliderBullets} />}
          loop={false}
        >
          <SliderContent
             // some content
          />
          <SliderContent
             // some content
          />
          <SliderContent
            // some content
          />
          <SliderContent
            // some content
          />
          <SliderContent
            // some content
          />
        </Swiper>
      </ScrollView>

If I swipe to second slide and come back to first one it shows the first slide.

Can anyone tell that why is the first slide empty until first swipe?

Additional Info:

RN: 0.42.3
Android: 7.1.2 Nexus 5X
React native swiper: 1.5.4

Most helpful comment

Disabling removeClippedSubviews from the Swiper component fixed this issue for me.

              <Swiper
                height={190}
                showsButtons={true}
                removeClippedSubviews={false}>

All 20 comments

+1, did you find any solution for this @sahil290791 ?

@nixoz, I do not think this is ScrollView's issue, even If I remove ScrollView, the swiper slides doesn't show up until first swipe.

@sahil290791 it is.

  1. Read the related issue https://github.com/facebook/react-native/issues/1831
  2. I've patched swiper and tested it on mine app. so the patch is fixing the issue.

@nixoz that patch that you applied is only for ios, I am facing this problem in android.

@sahil290791 - ahh, sorry man, my bad. Didn't paid attention to your's environment, coz faced that on ios ...ㅠㅠ

I guess ViewPagerAndroid is not playing well here.

@nixoz it works with your PR on ios, but can anyone merge this request soon?

@sahil290791 did you fix the problem on android?

@lisa718 Nope was unable, so I have enabled autoPlay now, which atleast doesn't show a blank slide.

@sahil290791 OK,thanks

Disabling removeClippedSubviews from the Swiper component fixed this issue for me.

              <Swiper
                height={190}
                showsButtons={true}
                removeClippedSubviews={false}>

Was this issue occurring in android for you?

@douglaswissett : Tks, it work. 👍

when i push home button,and enter into app again,the image was gone.........and also at first time,the image could not show up.....

@douglaswissett cool! this issue bothered me for a long time. now it works!

@douglaswissett this facing this issue, I added removeClippedSubviews={false} to Swiper image also not showing

@lisa718 same as you. did you find any solution for this ?

@douglaswissett Thank you. It works.

@douglaswissett Thank you it works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tibic picture tibic  ·  3Comments

gwhite-dayspring picture gwhite-dayspring  ·  3Comments

chetanparakh picture chetanparakh  ·  3Comments

ghost picture ghost  ·  3Comments

diegolmello picture diegolmello  ·  3Comments