webraptor / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
126 stars 81 forks source link

Swipe does not work for android device. Same code work for IOS #18

Closed dongdyang closed 3 years ago

dongdyang commented 3 years ago
  <Swiper
    cards={data}
    ref={(swiper) => {
      swipeRef.current = swiper;
    }}
    renderCard={renderHomeCard}
    onTapCard={_onTabCard}
    // no sure swipe is working on android or not, if not, check this place
    // this is a fix from https://github.com/alexbrillant/react-native-deck-swiper/issues/218
    // useViewOverflow={Platform.OS === "ios"}
    style={styles.swiperContainer}
    cardHorizontalMargin={0}
    cardIndex={0}
    backgroundColor="white"
    stackSize={1}
    onSwipedAll={onSwipedAllCards}
    swipeBackCard={true}
    animateOverlayLabelsOpacity
    disableBottomSwipe={true}
    onSwipedLeft={(index) => handleOnSwipeCard("left", index)}
    onSwipedRight={(index) => handleOnSwipeCard("right", index)}
    onSwipedTop={(index) => handleOnSwipeCard("top", index)}

/>

Code sample is above. Could you please help?

dongdyang commented 3 years ago

it is no problem now. i started from anthor's example, and add new code step and step. Finally it works out!

webraptor commented 3 years ago

it is no problem now. i started from anthor's example, and add new code step and step. Finally it works out!

glad to hear all good!