[英]How to temporarily hide a presented View controller that is also presenting a view controller
I have a rather abnormal situation where I am presenting a view controller which is a UITabBarViewController that contains the bulk of my app. 我有一个非常不正常的情况,我正在展示一个视图控制器,它是一个UITabBarViewController,其中包含我的大部分应用程序。
There are times when I need to temporarily hide that main controller and all of it's 'stuff'. 有时候,我需要暂时隐藏该主控制器,而所有这些都是“东西”。 On my root controller I can hold a reference to my presented tabBarController and dismiss that with self.dismissViewControllerAnimated and then represent that when I need it.
在我的根控制器上,我可以保存对所呈现的tabBarController的引用,并使用self.dismissViewControllerAnimated消除它,然后在需要时表示它。 But the issue I'm having is that I'm loosing any viewControllers that are presented by the tabBarController itself.
但是我遇到的问题是我失去了tabBarController本身提供的所有viewControllers。
Is there a better way to accomplish this, or a way to keep the view controllers presented by my tab bar controller from being dismissed? 有没有更好的方法可以做到这一点,还是可以防止选项卡栏控制器显示的视图控制器被关闭?
You could have a segue which presents something from the view controller that contains the tab bar controller over top it. 您可能有一个segue,它可以从视图控制器中显示某些内容,该视图控制器顶部包含标签栏控制器。 Without know more about this, I can't give you much help.
没有更多的了解,我不能给您太多帮助。 This will maintain the state of the tab bar controller.
这将保持标签栏控制器的状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.