Closed creativemind1 closed 3 years ago
You can't use flex on the parent of SwipeCards
just like that... for more info check #9.
TL;DR possible solutions:
Dimensions.get('window').height / 2
(this will take up half of the screen's height.onLayout = (event) => { const { width, height } = event.nativeEvent.layout; this.setState({ cardWidth: width, cardHeight: height }) };
to set the size of the swipe cards after you know what space is left for you to use...I've tried all the above issues before except 2nd. Second one looks closer to my solution however, in all possibilities above, one thing is causing so much trouble and that is more space which is getting created when removing cards (in from stack of cards).
Sorry, but I can't understand the problem...
When more number of swiping takes place, more number of spacing gets created below the Swiper container if I adopt Dimension.window.height
solution
It seems to me that you are looking for a fixed size of the swipe cards - so just make the parent of a fixed size or try to apply it to the SwipeCards
style directly:
style={{
//flex: 1, // <<-- remove this
height: 300,
}}
No, I'm looking for a dynamic height for SwipeCards
.
The problem here is not the swipe cards, I can't help you since it is up for you to figure out how to structure your screen to be responsive/looks as you want it.
From the code attached I can see a couple of styling problems that are not related to the lib.
We have an app working with a header and a footer for the cards and it is very responsive with the same solution I gave you earlier. Please note that the content or the cards can affect it's behavior on flexable layouts
Hello,
I'm stumbling with my current layout as I've to put so many dirty hacks to avoid the elements get overlapped with swiping cards.