Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

Real UINavigation animation #11

Closed
AlexKvazos opened this issue Jun 23, 2016 · 4 comments
Closed

Real UINavigation animation #11

AlexKvazos opened this issue Jun 23, 2016 · 4 comments

Comments

@AlexKvazos
Copy link

Is there a way to animate it so that the when a new view is pushed into the controller, the active view doesn't slide to the left to let the new one come in?

And when a view is popped, it will slide to the right and the previous one will be behind it instead of sliding from the left.

Right now the animation looks like a carousel while UINavigationController doesn't really look like a carousel.

Regards, Alex

@aputinski
Copy link
Owner

I believe what you are looking for are the REVEAL_ and COVER_ transition styles: https://github.com/aputinski/react-navigation-controller#pushviewview-options

@AlexKvazos
Copy link
Author

Is there a demo of those two working side by side?

@aputinski
Copy link
Owner

If you're looking to mimic the exact transition of UINavigationController, you can pass a function as the transition option and do whatever you'd like:

navigationController.pushView(<MyView />, {
  transition(prevElement, nextElement, done) {
    // Do some sort of animation on the views
    prevElement.style.transform = 'translate(100%, 0)';
    nextElement.style.transform = 'translate(0, 0)';
    // Tell the navigationController when the animation is complete
    setTimeout(done, 500);
  }
});

@AlexKvazos
Copy link
Author

Ah sweet, just what I was looking for. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants