Has anyone else noticed that changing the tab bar height programmatically is not working in iOS 13? Does anyone have a workaround? Same code works perfectly in iOS 11 and 12, but the tab bar is not resizing in iOS 13. Thanks
Asked
Active
Viewed 1,323 times
1 Answers
7
Without a snippet of your code it's hard to say what's wrong, but setting tab bar height's by subclassing UITabBarController and setting the tab bar height in viewDidLayoutSubviews
works in both iOS 12 and 13.
class MainTabBarViewController: UITabBarController {
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let tabBarHeight: CGFloat = 120
var tabFrame = tabBar.frame
tabFrame.size.height = tabBarHeight
tabFrame.origin.y = view.frame.size.height - tabBarHeight
tabBar.frame = tabFrame
}
}

evanjd
- 415
- 7
- 12
-
Thank you, @evanjd – Brittany Oct 04 '19 at 15:25
-
3Ah ok, the difference for me is using viewDidLayoutSubviews() instead of viewWillLayoutSubviews(). Thanks! – Brittany Oct 04 '19 at 16:46
-
This is not working in ios 13 – Mak K Jul 16 '20 at 12:31