我有一个UITabBarController,需要随时显示TabBar。在表示Tab的ViewController中,我使用childViewController.modalPresentationStyle = .overCurrentContext表示其他视图控制器。当我展示一个ChildViewController (UIViewControllerA0,.)时,我会显示一个导航条。回到过去,我解散了currentChildViewController。
这很好,但是下面的步骤以一个黑色屏幕结束。
我的UIStructure是
UITabBarController
|-UINavigationController
| --UIViewControllerA Tab
| --UIViewControllerA0
| --UIViewControllerA1
|
|--UINavigationController
| --UIViewControllerB Tab
| --UIViewControllerB0
| --UIViewControllerB1
|
|--UINavigationController
| --UIViewControllerC Tab
| --UIViewControllerC0
| --UIViewControllerC1
|我已经尝试过几个presentationStyles,但是我需要在显示"ChildViewController“时显示Tabbar。我还试图以某种方式重新加载ViewController,但失败了,我认为这不是正确的方法。
是否存在这样的解决方案,还是不可能使用这样的TabNavigation?
亲切问候
发布于 2019-02-06 16:48:44
好吧,这很奇怪,这是我的presentationContext和PresentationStyle的开始组合,但是我再次尝试并将它设置为" start“,现在它适用于以下设置:
在UIViewControllerA中,例如,当呈现一个子
childViewController.modalPresentationStyle = .overCurrentContext self.definesPresentationContext = true self.present(childViewController, animated: true, completion: nil)
关闭我调用的ChildViewController时
childViewController.dismiss(animated: true) {}现在我可以在选项卡上保留一个ChildViewController,在选项卡之间切换,甚至可以在其他选项卡上打开其他ChildViewControllers,并且在关闭ChildViewController时显示正确的ViewController (UIViewControllerA、UIViewControllerB或UIViewControllerC)。
我花了好几个小时在这件事上,现在似乎很容易.
https://stackoverflow.com/questions/54558056
复制相似问题