在标签栏上推送/呈现视图控制器 Swift
push / present view controller over tab bar Swift
我尝试重现与 example 的 fb messenger 中相同的推送屏幕的方式。
我的架构:TabController -> NavController-> embedVC-> pushedVC。
pushedVC 必须在标签栏上。我不想用 tabbar.isHidden = true.
隐藏它
尝试在需要隐藏标签栏的屏幕上使用 UIViewController.hidesBottomBarWhenPushed = true。
您也可以尝试将 UITabBarController 安排为 UINavigationController 中的子项。
据我所知(我可能是错的),UITabBarController 不会在 UINavigationController 中工作,所以有时有人使用他们的自定义 TabBarController。
SWIFT 5(也适用于以前的版本)
在推送 ViewController 之前,设置 hidesBottomBarWhenPushed = true
示例:
let viewController = UIViewController()
viewController.hidesBottomBarWhenPushed = true
navigationController?.pushViewController(viewController, animated: true)
我尝试重现与 example 的 fb messenger 中相同的推送屏幕的方式。
我的架构:TabController -> NavController-> embedVC-> pushedVC。
pushedVC 必须在标签栏上。我不想用 tabbar.isHidden = true.
隐藏它尝试在需要隐藏标签栏的屏幕上使用 UIViewController.hidesBottomBarWhenPushed = true。 您也可以尝试将 UITabBarController 安排为 UINavigationController 中的子项。 据我所知(我可能是错的),UITabBarController 不会在 UINavigationController 中工作,所以有时有人使用他们的自定义 TabBarController。
SWIFT 5(也适用于以前的版本)
在推送 ViewController 之前,设置 hidesBottomBarWhenPushed = true
示例:
let viewController = UIViewController()
viewController.hidesBottomBarWhenPushed = true
navigationController?.pushViewController(viewController, animated: true)