我在用:

ViewController = [[ViewControllerClass alloc] initWithNibName:@"ViewControllerClass" bundle:[NSBundle mainBundle]];
self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:frontViewController animated:YES completion:nil];


我正在尝试将UIViewController滑到左侧,但是我不确定为什么它不起作用。我什至在尝试:

UIModalTransitionStyleCrossDissolve


这是行不通的。请提出如何实施UIViewController左右滑动的建议。

最佳答案

当您调用presentViewController:animated:completion:时,这将在当前控件之上显示一个模式视图控制器。默认的过渡是将视图控制器从底部向上滑动。 UIModalTransitionStyle枚举定义了四种可能的转换。

模态过渡不支持左/右过渡。

当使用UINavigationController及其pushViewController:animated:和各种pop...方法时,左/右过渡是标准过渡。

[self.navigationController pushViewController:viewController animated:YES];




要关闭顶视图控制器,请执行以下操作:

[self.navigationController popViewControllerAnimated:YES];

10-07 12:46
查看更多