#pragma mark --
#pragma mark -- 创建子控制器
- (void)createSubViewControllers{
OneViewController *One = [[OneViewController alloc]init];
CustomNavigationController *navOne = [[CustomNavigationController alloc]initWithRootViewController:One];
navOne.fullScreenPopGestureEnabled = YES;
TwoViewController *Two = [TwoViewController new];
CustomNavigationController *navTwo = [[CustomNavigationController alloc]initWithRootViewController:Two];
navTwo.fullScreenPopGestureEnabled = YES;
ThreeViewController *Three = [[ThreeViewController alloc]init];
CustomNavigationController *navThree = [[CustomNavigationController alloc]initWithRootViewController:Three];
navThree.fullScreenPopGestureEnabled = YES;
FourViewController *Four = [[FourViewController alloc]init];
CustomNavigationController *navFour = [[CustomNavigationController alloc]initWithRootViewController:Four];
navFour.fullScreenPopGestureEnabled = YES;
self.delegate = self;
self.viewControllers = @[navOne,navTwo,navThree,navFour];
}
#pragma mark --
#pragma mark -- 设置所有的、分栏元素项
- (void)setTabBarItems{
NSArray *titleArr = @[@"查单词",@"查词根",@"记单词",@"我的"];
NSArray *normalImgArr = @[@"licai",@"dis",@"my",@"dis"];
NSArray *selectedImgArr = @[@"licaiSele",@"disSele",@"dis",@"mySele"];
for (int i = 0; i<titleArr.count; i++) {
UIViewController *vc = self.viewControllers[i];
vc.tabBarItem = [[UITabBarItem alloc]initWithTitle:titleArr[i] image:[UIImage imageNamed:normalImgArr[i]] selectedImage:[[UIImage imageNamed:selectedImgArr[i]]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ]];
vc.tabBarItem.tag = i+1;
}
}