as you can see from the picture, the tab bar color is black. I hide the tab bar when segmented control tapped
@IBAction func segmentedControlTapped(sender: AnyObject) {
if segmentedControl.selectedSegmentIndex == 1 {
self.viewUIPickerView.viewWithTag(10)?.hidden = false
self.viewUIPickerView2.viewWithTag(11)?.hidden = true
}else {
self.viewUIPickerView2.viewWithTag(11)?.hidden = false
self.viewUIPickerView.viewWithTag(10)?.hidden = true
}
self.tabBarController!.tabBar.hidden = true
}
and i try usinghidesBottomBarWhenPushed = true
still doesnt work.
Swift 4: Programatically
Worked Perfectly for me.
func hideTabBar() {
self.tabBarController.tabBar.isHidden = true
self.tabBarController.tabBar.isTranslucent = true
}
func showTabBar() {
self.tabBarController.tabBar.isHidden = false
self.tabBarController.tabBar.isTranslucent = false
}
You are using hidesBottomBarWhenPushed
in the view with the tab controller. But you must set this in the controller that you will push.
Set it into prepare for segue
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
segue.destination.hidesBottomBarWhenPushed = true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With