因此,我有一个应用程序,其中初始屏幕是一个视图控制器。在vc中,我有一个打开弹出式TabBarController的按钮。但是,当我关闭该弹出窗口时,选项卡栏仍然存在。基本上,我正在尝试关闭TabBarController,以使tabBar消失。我不想只隐藏TabBar,我希望它消失。 谢谢。
这是我将TabBarController作为弹出窗口显示的方式
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "MyTabBarController") as! MyTabBarController
self.addChild(vc)
vc.view.frame = self.view.frame
vc.edgesForExtendedLayout = []
self.view.addSubview(vc.view)
vc.didMove(toParent: self)
答案 0 :(得分:1)
您尝试过
vc.view.removeFromSuperView()
从父viewcontroller或刚刚从dismiss
调用MyTabBarController