【发布时间】:2019-03-21 12:31:51
【问题描述】:
我有三个视图控制器:
- FeedController(
UITabBar可见) - PostController(
UITabBar已隐藏) - UserController(
UITabBar可见
我使用以下代码从 FeedController 到 PostController:
let postVC = PostController()
postVC.hidesBottomBarWhenPushed = true
pushViewController(postVC, animated: true)
postVC.hidesBottomBarWhenPushed = false
然后,从 PostVC 到 UserVC:
let userVC = UserController()
userVC.hidesBottomBarWhenPushed = false
pushViewController(userVC, animated: true)
效果很好。除了导航到帖子时,它会在任何地方显示UITabBar。但是,当我从帖子中转到用户配置文件 (UserController) 时,就会出现问题。它按预期在配置文件上显示UITabBar,但是当我向后导航(使用UINavigationController 中的后退按钮)时,UITabBar 仍然可见。当我从 userVC 回到 postVC 时,我希望它再次被隐藏。
有什么办法可以做到吗?
【问题讨论】:
标签: ios swift uinavigationcontroller uitabbarcontroller