2

Possible Duplicate:
How to change the Push and Pop animations in a navigation based app

Using MonoTouch and MonoTouch.Dialog, I have a DialogViewController that I'm pushing onto a UINavigationController and when I do so it makes the current screen being displayed move off from right to left. I was wondering how I would go about reversing that, making the current screen be "pushed off" left to right, like when you press a back button. My code is below, where _root is a RootElement.

_viewController = new DialogViewController(_root, false);
_navController.PushViewController(_viewController, true);

EDIT: I've tried using _viewController.ModalTransitionStyle and such to no avail if this information helps.

Community
  • 1
  • 1
Smoore
  • 732
  • 2
  • 10
  • 27

1 Answers1

3

You can find the answer by searching Stack Overflow. For instance here: How to change the Push and Pop animations in a navigation based app

MainView *nextView = [[MainView alloc] init];
[UIView animateWithDuration:0.75
                         animations:^{
                             [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
                             [super pushViewController:nextView animated:NO];
                             [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
                         }];

This easily translates in MonoTouch and will become something like (untested):

UIView.Animate(0.75f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate {
                navController.PushViewController(...);
                UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromRight, navController.View, false);
            }, null);
Community
  • 1
  • 1
Krumelur
  • 32,180
  • 27
  • 124
  • 263