In iOS 18, I've noticed that the tab bar is now positioned at the top of the screen on iPad devices. I'm trying to hide the tab bar programmatically, but setting TabBarController.tabBar.isHidden = true doesn't seem to have any effect. Has anyone else encountered this issue, or does anyone know an alternative method to successfully hide the tab bar in this version of iOS? Any guidance would be greatly appreciated.
I have tried to update the isTranslucent ,alpha , but they don't have effect on tabbar.
class YourTabBarController: UITabBarController {
override func viewDidLoad() {
if #available(iOS 18.0, *) {
traitOverrides.horizontalSizeClass = .compact
}
}
}
This code worked for me. Hope it helps!
In my case I just had to point the tabBar and hide it - I hope it helps!
if #available(iOS 18.0, *) {
myTabBarController.setTabBarHidden(true, animated: false)
} else {
myTabBarController.tabBarController?.tabBar.isHidden = 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