从侧面菜单中选择菜单项TabBar会消失吗?

时间:2018-04-18 09:25:23

标签: ios swift uitabbarcontroller swrevealviewcontroller

我几乎在所有vc中都有汉堡按钮(菜单按钮),我的主屏幕是tabBarController。目前我点击按钮时会看到侧边菜单。在选择菜单时,它会显示所需的vc,但在我选择菜单项之前,底部的标签栏不存在。我希望整个页面中的底部标签栏也位于侧边菜单的页面中。我用汉堡菜单SWRevealViewController

我怎样才能实现这一目标?请帮帮我。

我在didSelectRowAtIndexPath中使用的代码是:

if indexPath.row == 1 {
    let destinationVc = self.storyboard?.instantiateViewController(withIdentifier: "Home")
    let newFrontVc = UINavigationController.init(rootViewController:destinationVc!)
    revealViewController.pushFrontViewController(newFrontVc, animated: true)
}

1 个答案:

答案 0 :(得分:0)

您必须在navBarVc和frontVc

之间添加tabBarController
let navBarVc = UINavigationController()
let tabBarVc = navBarVc.childViewControllers[0] as! tabBarController
    tabBarVc.selectedViewController = yourVc

那是怎么回事。

相关问题