iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

前端 未结 30 2488
误落风尘
误落风尘 2020-11-29 17:05

Anyone having issue with the iPhone X simulator around the UITabBar component?

Mine seem to be rendering the icons and title on top of each other, I\'m not sure if I

30条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 17:38

    I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews.

    -(void)viewDidLayoutSubviews
    {
        [super viewDidLayoutSubviews];
        [self.tabBar invalidateIntrinsicContentSize];
    }
    

    Note: The bottom of the tab bar will need to be contained to the bottom of the main view, rather than the safe area, and the tab bar should have no height constraint.

提交回复
热议问题