Closed fungilation closed 7 years ago
I also have the same problem. Installed latest version react-native and react-native-swiper (1.5.7). Can anyone help?
Same here. Updated react-native and react-native-swiper (1.5.7)
Is it the same issue than #495 ?
Looks like it.
@arribbar updated to 1.5.8, no dice. Exact same issues and resulting screenshots as I wrote above.
@mrdezzods re-open please.
Strange though. I tried all the examples and they worked fine. Maybe can you show your code?
@mrdezzods I've updated my original post with a self containing test case, along with my app's package.json
in case it's due to conflicts with other packages, though I think unlikely.
Same issue. "react": "16.0.0-alpha.12", "react-native": "0.47.1", with: "react-native-swiper": "1.5.5", => work, but not have onIndexChange function. with: "react-native-swiper": "1.5.8", => not render every thing.
@nuocgansoi Can you try with RN Swiper 1.5.9 version ?
@fungilation Thanks for your time
@arribbar,
Thanks for bug hunting with me.
Ok @fungilation, your issue is not coming from RN Swiper but updates in style from RN. You have to :
style={{ flex:1 }}
to your first viewflex: 1
It works perfectly in my case.
That does work. Thanks @arribbar!
Though I don't fully understand why. And Swiper 1.5.5 did work so what changed on Swiper's side that requires a change in container styling? Would be useful to document for others with similar issues since upgrading from 1.5.5
I'm not sure. In the changes between 1.5.5 and 1.5.6, there is a new prop containerStyle (https://github.com/leecade/react-native-swiper/blob/6fd0c3d314414f34acec9b9e83ef5198156705bf/src/index.js#L668) which can override container style (https://github.com/leecade/react-native-swiper/blob/6fd0c3d314414f34acec9b9e83ef5198156705bf/src/index.js#L26).
We also added flex: 1
to container style since 1.5.5.
You can try changing these values and check what is working best to you.
This is the basic layout of my app, I've isolated below as a test case. Its
Component
'srender()
function:Preceding imports (somewhat verbatim from my app):
This creates a horizontal Swiper view (
AppSwiper
), withheight={whLarge - 40}
. Followed by a View (NavBar
) that forms a black buttons bar at the bottom below the AppSwiper.With upgrade to 1.5.7 (from 1.5.5), the entire height of the AppSwiper vanished. Same for "swiping" on the 10 children views within. The NavBar that was at the bottom is now at the top, with nothing following it.
Before: (1.5.5)
After: (1.5.8)
Anyone else seeing similar layout busted on 1.5.7, 1.5.8?
My full
package.json
for the above test case, you probably don't need all packages to reproduce: