Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change tabBar height in Swift 5 for IOS 13

I need to change the UITabBar height to 95. I can do that in the older version of iOS Swift. This is my code that work in the older version.

override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews()

    tabBar.frame.size.height = 95
    tabBar.frame.origin.y = view.frame.height - 95

    menuButton.frame.origin.y = self.view.bounds.height - tabBar.frame.size.height - 10
    shadowBtn.frame.origin.y = self.view.bounds.height - tabBar.frame.size.height - 15
}
like image 827
Fabio Cirruto Avatar asked Dec 01 '22 09:12

Fabio Cirruto


1 Answers

Try it in viewDidLayoutSubviews

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    tabBar.frame.size.height = 95
    tabBar.frame.origin.y = view.frame.height - 95
}
like image 69
Sargis Terteryan Avatar answered Dec 05 '22 08:12

Sargis Terteryan