- (void)initTabbar
{
ZPayViewController *zpay = [[ZPayViewController alloc]init];
ButlerController *butler = [[ButlerController alloc]init];
Detail1ViewController *detail = [[Detail1ViewController alloc]init];
SetPayViewController *setPay = [[SetPayViewController alloc]init];
NSMutableArray *vcArr = [NSMutableArray arrayWithObjects:zpay,detail,butler,setPay, nil];
NSArray *titleArr = @[@"帮付宝",@"账单",@"管家",@"设置"];
NSArray *picArr = @[@"Button_帮付宝_line",@"Button_账单_line",@"Button_管家_line",@"Button_设置_line"];
NSArray *selectPicArr = @[@"Button_帮付宝_solid",@"Button_账单_solid",@"Button_管家_solid",@"Button_设置_solid"];
for (int i = 0; i < vcArr.count; i++) {
UIViewController *vc = vcArr[i];
vc.title = titleArr[i];
UINavigationController *nc =[[UINavigationController alloc]initWithRootViewController:vc];
[nc.tabBarItem setImage:[[UIImage imageNamed:picArr[i]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[nc.tabBarItem setSelectedImage:[[UIImage imageNamed:selectPicArr[i]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[vcArr replaceObjectAtIndex:i withObject:nc];
}
self.viewControllers = vcArr;
}