self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
ViewController *vc = [[ViewController alloc]init];
UINavigationController *nvc = [[UINavigationController alloc]initWithRootViewController:vc];
[vc.navigationItem setTitle:@"第一页"];
[vc.tabBarItem setTitle:@"Message"];
[vc.tabBarItem setImage:[UIImage imageNamed:@"message.png"]];
[vc.tabBarItem setBadgeValue:@"99+"];
//设置字体颜色
[vc.tabBarItem setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateNormal];
[vc.tabBarItem setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateHighlighted];
[vc.view setBackgroundColor:[UIColor blueColor]];
SecondViewController *svc = [[SecondViewController alloc]init];
UINavigationController *snvc = [[UINavigationController alloc]initWithRootViewController:svc];
[svc.navigationItem setTitle:@"第一页"];
[svc.tabBarItem setTitle:@"Setting"];
[svc.tabBarItem setImage:[UIImage imageNamed:@"setting.png"]];
[svc.tabBarItem setBadgeValue:@"999+"];
[svc.view setBackgroundColor:[UIColor yellowColor]];
UITabBarController *tb = [[UITabBarController alloc]init];
tb.viewControllers = @[nvc,snvc];
[tb.tabBar setTintColor:[UIColor redColor]];
[tb.tabBar setBarTintColor:[UIColor orangeColor]];
[self.window setRootViewController:tb];
[self.window makeKeyAndVisible];