自定义tabbar,唯独iPhone X模拟器会出现这个问题:当push之后pop回来的时候 系统tabbar会出现 导致tabbar重叠。 其他机型都没有这个问题。
-(void)viewDidAppear:(BOOL)animated;
-(void)viewWillLayoutSubviews;
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
在以上方法中删除系统tabbar
for (UIView *tabBar in self.tabBarController.tabBar.subviews) {
if ([tabBar isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
[tabBar removeFromSuperview];
}
}
执行上面代码时tabBar为空,执行过后系统tabbar确显示出来了。