我有这段代码显示了两个 View Controller 之间的转换,但问题是我想像在推送 View Controller 中一样显示从右到左的转换....
UIViewController *previousController = [self.childViewControllers objectAtIndex:[self.childViewControllers count]-2];
[self transitionFromViewController:previousController toViewController:controller duration:0.5 options:UIViewAnimationOptionAllowAnimatedContent animations:NULL completion:NULL];
任何帮助将不胜感激
最佳答案
我认为这是更好的方法来满足您的需求,
NSMutableArray *vcs = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
UIViewController *previousController = [self.childViewControllers objectAtIndex:[self.childViewControllers count]-2];
[vcs insertObject:previousController atIndex:[vcs count]-1];
[self.navigationController setViewControllers:vcs animated:NO];
[self.navigationController popViewControllerAnimated:YES];
关于ios - 将 View 从右移到左,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17274476/