iOS 多级页面执行popToRoot方法造成tabbar消失问

2023-03-15  本文已影响0人  Mi_Manchi_

关于iOS在项目中跳转两层以上页面执行popToRootViewControllerAnimated方法时,发现会造成底部tabbar隐藏。
解决办法:
重写RootNavigationController的popToRootViewControllerAnimated方法
、、、-(NSArray<__kindof UIViewController>)popToRootViewControllerAnimated:(BOOL)animated{

if(self.viewControllers.count>1){
     self.topViewController.hidesBottomBarWhenPushed=NO;
  }
return [superpopToRootViewControllerAnimated:animated];

}

上一篇 下一篇

猜你喜欢

热点阅读