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

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

作者: Mi_Manchi_ | 来源:发表于2023-03-15 17:46 被阅读0次

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

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

}

相关文章

网友评论

      本文标题:iOS 多级页面执行popToRoot方法造成tabbar消失问

      本文链接:https://www.haomeiwen.com/subject/xfolrdtx.html