iOS自定义TabBar使用popToRootViewControllerAnimated返回后tabbar重叠

解决方法

所以方法就是:遵循UINavigationController的代理,用代理方法解决该Bug,代码如下:

实现代理方法:

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated  
  1. {  
  2. // 删除系统自带的tabBarButton  
  3. for (UIView *tabBar in self.tabBarController.tabBar.subviews) {  
  4. if ([tabBar isKindOfClass:NSClassFromString(@"UITabBarButton")]) {  
  5.             [tabBar removeFromSuperview];  
  6.         }  
  7.     }  
  8. }  
原文地址:https://www.cnblogs.com/duzhaoquan/p/6026576.html