Additional answer
A radar is open about this problem here.
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
// Disable tabBar shifts upward whenever a ViewController is pushed on iPhone X rdar://35098813
BOOL isIPhoneX = ...
if (isIPhoneX && UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
[self.tabBar setFrame:CGRectMake(0, CGRectGetHeight(self.view.frame) - CGRectGetHeight(self.tabBar.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.tabBar.frame))];
}
}
Original answer
I think this is a bug of iOS 11.
You can remove that weird effect to put down this code to your subclass of UITabBarController
.
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
BOOL isIPhoneX = ...
if (isIPhoneX && UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
[self.tabBar setFrame:CGRectMake(0, self.view.frame.size.height - 83, 375, 83)];
}
}
The solution is weird, too. :)