0

I'm having an issue on iPhoneX using XCode9.2 but I have no issue running the app using XCode8.

From my findings are the UITabBar height is set at 49.

UITabBarButton height is 14 for iPhoneX but UITabBarButton is 49 for iPhone 6

Any ideas how to resolve this in XCode9?

Here's how it's displaying on iPhone X:

iPhone X iOS 11.2

And here's how it's displaying on iPhone 6:

iPhone 6 iOS 11.2

Lauraducky
  • 674
  • 11
  • 25
khheng
  • 147
  • 1
  • 9

1 Answers1

0
viewController.hidesBottomBarWhenPushed = YES;

I guess you used it.

So this problem arises.

you need in

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated

add this code:

if (@available(iOS 11.0, *)){

    CGFloat height = [UIApplication sharedApplication].statusBarFrame.size.height > 20.0f ? 83.0f : 49.0f;

    CGRect frame = CGRectMake(0.0f, [UIScreen mainScreen].applicationFrame.size.height - height, [UIScreen mainScreen].applicationFrame.size.width, height);

    self.tabBarController.tabBar.frame = frame;
}
杨志强
  • 1
  • 1