1.UITabBarController的结构
三层结构:TabBar,Custom Content,Tab bar controlelr view
2.相关属性的设置
//准备视图控制器数组
NSArray *array = @[redNC,orangeNC,yellowNC,greenNC,cyanNC,blueNC,purpleNC];
//创建tabBarController
UITabBarController *tabBC = [UITabBarController new];
//设定子视图控制器
tabBC.viewControllers = array;
//设置整个 tabBar 的颜色
// tabBC.tabBar.barTintColor = [UIColor lightGrayColor];
//tabBar高度49
//tabBar 样式
// tabBC.tabBar.barStyle = UIBarStyleBlack; //透明
//给tabBar设置背景图片
tabBC.tabBar.backgroundImage = [UIImage imageNamed:@"image"];
//设置标题颜色(着色,字体颜色)
tabBC.tabBar.tintColor = [UIColor magentaColor];
//设置选中下标
tabBC.selectedIndex = 2;
//设置bageValue
redVC.tabBarItem.badgeValue = @"99+";
//设置代理对象
tabBC.delegate = self;
//统一修改(一键换肤)
[[UINavigationBar appearance] setBarTintColor:[UIColor magentaColor]];
//指定为根视图控制器
[self.window setRootViewController:tabBC];