How to correct Tab Bar height issue on iPhone X

前端 未结 20 3479
长发绾君心
长发绾君心 2020-12-13 13:07

I\'m having an issue with my app when testing for iPhone X. I\'m not sure how to adjust this issue, as well as not make it an issue for non iPhone X sizes. This only seems t

20条回答
  •  借酒劲吻你
    2020-12-13 13:38

    The solution for me was that I had a custom UITabBar height set, something like this:

      override func viewWillLayoutSubviews() {            
            var tabFrame = tabBar.frame
            tabFrame.size.height = 60
            tabFrame.origin.y = self.view.frame.size.height - 60
            tabBar.frame = tabFrame
        }
    

    Remove it and the tab bar will display correctly on iPhone X.

提交回复
热议问题