React-native-router-flux: Android: scenes transition vertically instead of horizontally

Created on 26 Feb 2018  路  3Comments  路  Source: aksonov/react-native-router-flux

I'm having a problem where, on android, the transitions between scenes/ pages is vertical, instead of horizontal. I was thinking I could add a prop to a scene, like so: <Scene direction="leftToRight" /> but this does not work. How should I go about fixing the transitions on android devices?

Version

  • react-native-router-flux v4.0.0-beta.22
  • react-native v0.49.3

Expected behaviour

Scenes transition horizontally (i.e. left-to-right) on both android and iOS devices.

Actual behaviour

On android: scenes transition vertically (from bottom-to-top) instead of horizontally like they do in iOS.

Steps to reproduce

  1. Set up project with multiple sciences. i.e.
<Router>
      <Stack>
        <Scene />
        <Scene />
        ...
  1. Navigate between scenes
  2. Should see iOS transitions vertically, while android transitions pages horizontally

I've tried <Stack key="root" transitionConfig={() => ({ screenInterpolator: CardStackStyleInterpolator.forHorizontal })}> but this throws an error: undefined is not a function (evaluating 'addListener'. Please do not link to https://github.com/aksonov/react-native-router-flux/issues/2628 and close this issue, because I've read through that thread and I'm still having issues.

Most helpful comment

Import this at the file you register scenes.
import CardStackStyleInterpolator from 'react-navigation/src/views/CardStack/CardStackStyleInterpolator';

And Add this to transitionConfig={() => ({ screenInterpolator: CardStackStyleInterpolator.forHorizontal })}
to your stack like this :

Edit : this error may occur of react-native-router-flux version i had this error before. I am using version
"react-native-router-flux": "^4.0.0-beta.26", now and it`s working perfectly fine.

All 3 comments

Import this at the file you register scenes.
import CardStackStyleInterpolator from 'react-navigation/src/views/CardStack/CardStackStyleInterpolator';

And Add this to transitionConfig={() => ({ screenInterpolator: CardStackStyleInterpolator.forHorizontal })}
to your stack like this :

Edit : this error may occur of react-native-router-flux version i had this error before. I am using version
"react-native-router-flux": "^4.0.0-beta.26", now and it`s working perfectly fine.

Show your main file with all your Scenes, as well as your imports please

@Dorentin1997 upgrading react-native-router-flux from v4.0.0-beta.22 to 4.0.0-beta.26 fixed it for me, thank you! Closing issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fgrs picture fgrs  路  3Comments

sarovin picture sarovin  路  3Comments

vinayr picture vinayr  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments

basdvries picture basdvries  路  3Comments