From left to right window animation with react-navigation?

拈花ヽ惹草 提交于 2019-11-29 07:54:16

when you define your screens, you can use transitionConfig option.

const Stack = StackNavigator(
  {
    SomeScreen: { screen: ... },
  },
  {
    transitionConfig: customAnimationFunc,
  }
);
...

import CardStackStyleInterpolator from 'react-navigation/src/views/CardStack/CardStackStyleInterpolator';

const customAnimationFunc = () => ({
  screenInterpolator: sceneProps => {
    return CardStackStyleInterpolator.forVertical(sceneProps);
  },
});

should do the job. You can of course define your own animation, or return null to disable it; check the sources for that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!