我有3个视图控制器,vc1,vc2,vc3 .
vc1表示vc2和vc3 .
在vc1中,我有委托方法来解除vc2并且在完成块中存在vc3 .
它工作正常 . 但是在视图切换之间,vc1会显示出来 . 所以vc2解雇,vc1 show,vc3出现 .
有没有办法在这个过程中不显示vc1?我试图在解雇和现场解雇动画 .
谢谢!
一个想法可能是在vc2之上呈现vc3 . 一旦你准备回到vc1,只需调用 [self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil]; ,你就可以弹出vc2和vc3,而不会看到vc2 .
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
一种技术是使用UINavigationController的 setViewControllers:animated 方法 . 从导航控制器中取出 viewControllers 数组,删除最后一项(VC2),追加VC3,然后将数组传递给 setViewControllers . 这本质上是一个pop-then-push,它应该按照你想要的方式制作动画 .
setViewControllers:animated
viewControllers
setViewControllers
2 回答
一个想法可能是在vc2之上呈现vc3 . 一旦你准备回到vc1,只需调用
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
,你就可以弹出vc2和vc3,而不会看到vc2 .一种技术是使用UINavigationController的
setViewControllers:animated
方法 . 从导航控制器中取出viewControllers
数组,删除最后一项(VC2),追加VC3,然后将数组传递给setViewControllers
. 这本质上是一个pop-then-push,它应该按照你想要的方式制作动画 .