【问题标题】:React Native disable navigation push animationReact Native 禁用导航推送动画
【发布时间】:2020-06-07 07:24:58
【问题描述】:

考虑 React Native 中的一个简单示例,它使用 React Navigation 转到不同的屏幕,如何禁用过渡动画?

<Button
  title="Go to Details... again"
  onPress={() => navigation.push('Details')}
/>

See the example on Snack

【问题讨论】:

    标签: ios reactjs react-native react-navigation


    【解决方案1】:

    你试过设置“animationEnabled: false”吗?

    在此处查看相关文档:

    https://reactnavigation.org/docs/en/stack-navigator.html#animationenabled

    【讨论】:

      【解决方案2】:

      将animationEnabled设置为false

      screen: YourScreenName,
          navigationOptions: ({ navigation }) => ({
            animationEnabled: false,
          }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-01-24
        • 1970-01-01
        • 1970-01-01
        • 2022-12-24
        • 2015-02-15
        相关资源
        最近更新 更多