ios - 将 View 从右移到左

标签 ios

我有这段代码显示了两个 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/

相关文章:

ios - 如何从核心数据中获取数据并在表格 View 中显示 iOS 6

ios - 核心图像滤镜背景

ios - CoreData 对象未在屏幕之间保存

ios - 如何将文件从目录复制到iphone文档目录

ios - 如何设置 UIViewRepresentable 的大小?

ios - ZoomToRect后新CGRect的UIScrollview计算

objective-c - 为什么使用两种类型(边界/框架)而不是一种来描述 View ?

iphone - 如何禁用 iOS 标签栏中的蓝色突出显示?

ios - Facebook sdk io 从相册中获取照片

ios - 向 animateKeyframes 添加缓动