Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide elevated tabbar in iPadOS 18?

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.

like image 472
iroh Avatar asked Dec 10 '25 23:12

iroh


2 Answers

class YourTabBarController: UITabBarController {
    override func viewDidLoad() {
        if #available(iOS 18.0, *) {
            traitOverrides.horizontalSizeClass = .compact
        }
    }
}

This code worked for me. Hope it helps!

like image 164
Emin Turk Avatar answered Dec 14 '25 00:12

Emin Turk


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
}
like image 40
Matteo Galli Avatar answered Dec 14 '25 00:12

Matteo Galli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!