如何移除原生tabBar

     1,隐藏原生的tabbar

     2,自定义tabbar(添加在self.view 上出现bug:边缘手势无法实现,建议不要隐藏原生的tabbar  将自定义的tabbar添加在原生的上面 遮挡住原生的tabbar)

     

     

     1,不隐藏原生的tabbar 创建新的tabbar添加在self.tabbar上,去除原生的tabbar上的tabbarbutton

     注意:去除方式

     

     2,创建自定义的tabbar

     3,创建自定义的tabbar button

     3.1 获得按钮的个数:viewControllers

     利用super调用setViewControllers,为ViewControllers赋值

     内容:根据子视图控制器的tabbar item

     4,子类化 tabbar item 继承与uicontrol(有addTarget方法)

  

bug:边缘手势无法实现,建议不要隐藏原生的tabbar

     

     //1,隐藏原生的tabbar

     self.tabBar.hidden = YES;

     //2,创建自定义的tabbar

     newTabBar = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenH-49, kScreenW, 49)];

     [newTabBar setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"tab_bg_all.png"]]];

     [self.view addSubview:newTabBar];

     */

    

    //1.移除原生的tabbar button

    //[self removeTabBarButton];

    //bug:无法移除系统自带的tabbar Item

    //[在这里调用删除tabbar item的方法 此时tabbar button还未加载上 无法移除 所以在页面加载完成后再调用移除方法]

原文地址:https://www.cnblogs.com/yxt9322yxt/p/4755858.html