【问题标题】:React Native NavigationCardStackStyleInterpolator.forVertical() - How can I change the direction?React Native Navigation CardStackStyleInterpolator.for Vertical() - 如何更改方向?
【发布时间】:2023-04-04 20:43:01
【问题描述】:

我希望卡片从顶部而不是底部显示。使用NavigationCardStackStyleInterpolator.forVertical() 时有没有办法做到这一点?

【问题讨论】:

    标签: react-native


    【解决方案1】:

    我找到的一个解决方案是使用我自己的自定义插值器。

    我们可以使用NavigationCardStackStyleInterpolator 组件作为模板并进行更改

      const translateY = position.interpolate({
    inputRange,
    outputRange: ([height, 0, -10]: Array<number>)});
    

      const translateY = position.interpolate({
    inputRange,
    outputRange: ([-height, 0, -10]: Array<number>)});
    

    【讨论】:

      猜你喜欢
      • 2017-08-08
      • 2021-01-31
      • 1970-01-01
      • 1970-01-01
      • 2016-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多