=====================================
当控制器换控制器后 会把原先的控制器的View先移出(还没有被销毁) 和UINavigationControler一样
=====================================
如果UITabBarController有N个子控制器,那么UITabBar内部就会有N个UITabBarButton作为子控件
UITabBarButton里面显示什么内容,由对应子控制器的tabBarItem属性决定
UITabBarItem有以下属性影响着UITabBarButton的内容
标题文字
@property(nonatomic,copy) NSString *title;
图标
@property(nonatomic,retain) UIImage *image;
选中时的图标
@property(nonatomic,retain) UIImage *selectedImage;
提醒数字
@property(nonatomic,copy) NSString *badgeValue;
[tabbarVc.tabBar.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
=====================================
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// 删除系统自动生成的UITabBarButton
for (UIView *child in self.tabBar.subviews) {
if ([child isKindOfClass:[UIControl class]]) {
[child removeFromSuperview];
}
}
}