Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将视图从右向左移动_Ios - Fatal编程技术网

Ios 将视图从右向左移动

Ios 将视图从右向左移动,ios,Ios,我有这段代码,它显示了两个视图控制器之间的转换,但问题是我想显示从右到左的转换,就像在推视图控制器中一样 UIViewController *previousController = [self.childViewControllers objectAtIndex:[self.childViewControllers count]-2]; [self transitionFromViewController:previousController toViewContr

我有这段代码,它显示了两个视图控制器之间的转换,但问题是我想显示从右到左的转换,就像在推视图控制器中一样

        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];
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];