使用 SWReveal View Controller 隐藏选项卡栏项目
Tab bar items hiding using SWReveal View Controller
我正在使用 SWRevealViewController
,TabBar Controller
作为正面,VC 其中我放置了 TableView
作为 SWReveal VC
的后视图。
我的 UI 看起来像这样,
现在,当我单击 table 视图并想打开第一个标签栏 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,如何显示底栏?
你不应该用选择的 viewcontroller 和 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
}
我正在使用 SWRevealViewController
,TabBar Controller
作为正面,VC 其中我放置了 TableView
作为 SWReveal VC
的后视图。
我的 UI 看起来像这样,
现在,当我单击 table 视图并想打开第一个标签栏 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,如何显示底栏?
你不应该用选择的 viewcontroller 和 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
}