How to correct Tab Bar height issue on iPhone X

前端 未结 20 3487
长发绾君心
长发绾君心 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:51

    After trying a few solutions, what worked for me was adding the following line to viewDidLoad:

    [self.tabBar.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor].active = YES;
    

    Jonah's and Mehul Thakkar's answers pointed me in the right direction.

    Note: I only had a blank tab bar controller in storyboard. The tab bar images and view controllers were setup using the tabBarItem properties (e.g., tabBarItem.title on the view controllers).

提交回复
热议问题