【问题标题】:react native deck swiper library反应本机甲板滑动器库
【发布时间】:2021-09-13 11:52:11
【问题描述】:

enter image description here

我正在尝试更改下面显示的图像的布局 我想在顶部显示它们 我只想更改下面显示的图像的布局 我想在第一张卡片上方显示它们

export default function App({navigation}) {
  const [index, setIndex] = React.useState(0);
  const onSwiped = () => {
    transitionRef.current.animateNextTransition();
    setIndex((index + 1) % data.length);
  };

  return (
    <SafeAreaView style={styles.container}>
      <View
        style={{
          backgroundColor: 'black',
          opacity: 0.05,
          transform: [{rotate: '45deg'}, {scale: 1.6}],
          position: 'absolute',
          left: -15,
          top: 30,
        }}></View>
      <View style={styles.swiperContainer}>
        <Swiper
          ref={swiperRef}
          cards={data}
          cardIndex={index}
          renderCard={card => <Card card={card} />}
          infinite
          backgroundColor={'transparent'}
          onSwiped={onSwiped}
          onTapCard={() => swiperRef.current.swipeLeft()}
          cardVerticalMargin={50}
          stackSize={stackSize}
          animateCardOpacity={true}
          stackScale={8}
          stackSize={3}
          verticalSwipe={false}
          stackSeparation={13}
          animateOverlayLabelsOpacity
          animateCardOpacity
          disableTopSwipe
          disableBottomSwipe
        />
      </View>
    </SafeAreaView>
  );
}

【问题讨论】:

  • 请提供您的代码,以便我帮助您在哪里做错了。
  • 请检查代码
  • 您希望其他人在 y 轴或 z 轴上方?
  • 在顶部 y 轴上

标签: javascript react-native react-native-deck-swiper


【解决方案1】:

改变你的风格:top: 30 => top: -30

【讨论】:

  • bruh 我需要你的帮助,如果可能的话,请分享你的电子邮件
【解决方案2】:

使用堆栈分离。 stackSeparation={-20}

【讨论】:

猜你喜欢
  • 2021-03-08
  • 2022-10-25
  • 1970-01-01
  • 1970-01-01
  • 2021-02-18
  • 1970-01-01
  • 1970-01-01
  • 2021-12-11
  • 2021-05-18
相关资源
最近更新 更多