123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //
- // KDPTabBarVC.m
- // KuDianProject
- //
- // Created by 学丽 on 2019/7/4.
- // Copyright © 2019 KDP. All rights reserved.
- //
- #import "KDPTabBarVC.h"
- #import "KDPLiveDataViewController.h"
- #import "KDPSupplyGoodViewController.h"
- #import "KDPMainNavViewController.h"
- @interface KDPTabBarVC ()
- @end
- @implementation KDPTabBarVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self addChildViewController:[[KDPTopViewController alloc]init] imgName:@"tab_top_un" SelectImgName:@"tab_top_s" title:@"首页"];
- [self addChildViewController:[[KDPSupplyGoodViewController alloc] init] imgName:@"tab_huoyuan_un" SelectImgName:@"tab_huoyuan_s" title:@"货源"];
- [self addChildViewController:[[KDPLiveDataViewController alloc] init] imgName:@"tab_live_un" SelectImgName:@"tab_live_s" title:@"直播数据"];
-
- [self addChildViewController:[[KDPEarnViewController alloc]init] imgName:@"tab_eringin_un" SelectImgName:@"tab_eringin_s" title:@"收益"];
- }
- -(void)addChildViewController:(UIViewController *)childV imgName:(NSString *)imgname SelectImgName:(NSString *)selectImgName title:(NSString *)title
- {
- [childV.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:ThemeColor]} forState:UIControlStateSelected];
- KDPMainNavViewController *nav =[[KDPMainNavViewController alloc]initWithRootViewController:childV];
- UIImage *image=[UIImage imageNamed:imgname];
- image=
- [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- UIImage *selectImage=[UIImage imageNamed:selectImgName];
- selectImage=[selectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- childV.tabBarItem.selectedImage=selectImage;
- childV.tabBarItem.image=image;
- childV.tabBarItem.title = title;
- childV.title=title;
- childV.navigationItem.title = title;
- [self addChildViewController:nav];
- }
- @end
|