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


使用MonoTouch和MonoTouch.Dialog,我将DialogViewController推送到 UINavigationController上,当这样做时,它将使当前显示的屏幕从右向左移动。我想知道如何扭转这种状况,使当前屏幕从左到右“弹出”,就像按下后退按钮一样。
我的代码如下,其中_root是RootElement。

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

编辑:我试过使用_viewController.ModalTransitionStyle,如果此信息有帮助,则无济于事。

最佳答案

您可以通过搜索堆栈溢出来找到答案。例如这里:
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);

10-07 19:22
查看更多