我有一个UIViewController
,在故事板中将hidesBottomBarOnPush
设置为true。视图被推到UINavigationController
堆栈的顶部。这个UINavigationController
在UITabBarController
里面。这成功地隐藏了UITabBar
。然而,当我在其上推动另一个视图时,UITabBar
仍然被隐藏(即使在故事板中hidesBottomBarOnPush
设置为false)。我怎样才能让它只隐藏那个视图的UITabBar
?谢谢!
你必须将false
设置为hidesBottomBarWhenPushed
override var hidesBottomBarWhenPushed: Bool {
get {
return navigationController?.topViewController == self
}
set {
super.hidesBottomBarWhenPushed = false
}
}