gpt4 book ai didi

ios - 从侧面菜单中选择菜单项时,TabBar 会消失吗?

转载 作者:行者123 更新时间:2023-11-30 11:34:35 28 4
gpt4 key购买 nike

我几乎在所有 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)
}

最佳答案

您必须在 navBarVc 和 frontVc 之间添加 tabBarController

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

那怎么样。

关于ios - 从侧面菜单中选择菜单项时,TabBar 会消失吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49895991/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com