2012-09-28 34 views
2

可能重复:
How to change the Push and Pop animations in a navigation based app更改ViewController的转换方向?

使用MonoTouch的和MonoTouch.Dialog,我有一个DialogViewController是我推到UINavigationController,当我做到这一点,使得当前画面作为显示从右向左移动。我想知道如何解决这个问题,使当前屏幕从左到右“被推下”,就像当你按下后退按钮时一样。 我的代码如下,其中_root是RootElement。

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

编辑:我已经使用_viewController.ModalTransitionStyle和这样无济于事,如果这些信息有助于尝试。

回答

3

您可以通过搜索Stack Overflow找到答案。比如这里: 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]; 
         }]; 

这非常容易转换在MonoTouch的,将成为像(未经测试):

UIView.Animate(0.75f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { 
       navController.PushViewController(...); 
       UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromRight, navController.View, false); 
      }, null);