【问题标题】:Tab bar items hiding using SWReveal View Controller使用 SWReveal 视图控制器隐藏标签栏项目
【发布时间】:2019-10-02 03:58:15
【问题描述】:

我使用SWRevealViewControllerTabBar Controller 作为前面和一个VC,我在其中放置了TableView 作为SWReveal VC 的后视图。 我的用户界面看起来像这样,

现在,当我单击表格视图并想要打开第一个标签栏 VC 时,它会从底部隐藏我的标签栏。通过这段代码,我尝试打开我的TabBar Controller

var menuVCBeforeLoginArray = ["NewsVC","BookmarkVC","MessageVC"]
let vcIdentifier = menuVCBeforeLoginArray[indexPath.row]
    let vc = storyboard!.instantiateViewController(withIdentifier: vcIdentifier)
    let navVC = UINavigationController.init(rootViewController: vc)
    self.revealViewController().pushFrontViewController(navVC, animated: true)

现在,当它打开第一个标签栏时,它看起来像这样,带有隐藏的底栏。

即使我从侧边菜单打开 VC,如何显示底栏?

【问题讨论】:

    标签: ios swift swrevealviewcontroller


    【解决方案1】:

    您不应该使用带有navigation controller 的选定视图控制器进行推送。获取tabbar controller 并更改selectedIndex

    //var menuVCBeforeLoginArray = ["NewsVC","BookmarkVC","MessageVC"]
    //let vcIdentifier = menuVCBeforeLoginArray[indexPath.row]
    //let vc = storyboard!.instantiateViewController(withIdentifier: vcIdentifier)
    //let navVC = UINavigationController.init(rootViewController: vc)
    //self.revealViewController().pushFrontViewController(navVC, animated: true)
    
    if let tabBarController = self.revealViewController().frontViewController as? UITabBarController {
        tabBarController.selectedIndex = indexPath.row
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-13
      • 2023-03-27
      • 2018-08-04
      相关资源
      最近更新 更多