关闭两个模态视图控制器

关闭两个模态视图控制器

本文介绍了关闭两个模态视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个导航控制器,它提供一个模态viewController.从这个模态viewController内部,我展示了另一个模态viewController.我只想从最后一个模态viewController返回到navigationController(根viewController).与popToRootViewController类似,但适用于modalViewControllers;

I have a navigation controller which present one modal viewController. From inside this modal viewController I present another modal viewController. All I want is to get back from the last modal viewController to the navigationController (the root viewController).Something similar with popToRootViewController, but adapted for modalViewControllers;

NavigationController->当前模态ViewController A->当前模态ViewController B

NavigationController -> present Modal ViewController A -> present Modal ViewController B

我想从模式ViewCOntroller B返回到navigationCOntroller.

From modal ViewCOntroller B I want to return to navigationCOntroller.

这可能吗?

赞赏,亚历克斯.

推荐答案

问题已解决:)

我尝试了

[self.parentViewController.parentViewController dismissModalViewControllerAnimated:YES];

工作.

谢谢.

这篇关于关闭两个模态视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 18:13