【问题标题】:On selecting menu Item from the side menu TabBar gets disappear?从侧面菜单选项卡栏选择菜单项时消失?
【发布时间】:2018-09-28 11:26:02
【问题描述】:

我几乎在所有 vc 中都有汉堡按钮(菜单按钮),我的主屏幕是 tabBarController。目前,当我点击 Button 时,我正在获取侧面菜单。在选择菜单时,它会显示所需的 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)
}

【问题讨论】:

标签: ios swift uitabbarcontroller swrevealviewcontroller


【解决方案1】:

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

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

怎么样。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-29
    • 1970-01-01
    • 2012-07-12
    • 1970-01-01
    • 2018-03-02
    • 2015-01-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多