iOS14 pop时tabbar不显示的问题
2020-10-09 本文已影响0人
满庭花醉三千客
项目在iOS14上运行出现了一个问题,A->B->C,接着在C界面pop回A,tabbar居然消失了。
解决方案:
- (NSArray<__kindof UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated{
if (self.viewControllers.count > 0 ) {
UIViewController *popController = self.viewControllers.lastObject;
if ([popController isKindOfClass:[CustomCViewController class]]) {
popController.hidesBottomBarWhenPushed = NO;
}
}
return [super popToRootViewControllerAnimated:animated];
}
加油