// // CTTabbarController.m // wct_tabbar // // Created by Wcting on 2019/4/24. // Copyright © 2019年 EJIAJX_wct. All rights reserved. // #import "CTTabbarController.h" #import "ViewController.h" #import "UINavigationController+FDFullscreenPopGesture.h" @interface CTTabbarController () @property (nonatomic, strong)NSArray *arrTabImage; @property (nonatomic, strong)UIButton *buttonCurrent; //保存当前选中的按钮 @property (nonatomic, assign)NSInteger selectIndex; @end static CTTabbarController *tabbarController = nil; @implementation CTTabbarController +(CTTabbarController *)sharaTabbarController { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ tabbarController = [[CTTabbarController alloc] init]; }); return tabbarController; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. // self.view.backgroundColor = [UIColor redColor]; [self currentController]; } - (void)currentController { //首页 - 使用新版首页 self.vc1 = [[NewHomeViewController alloc] init]; //短剧 self.vc2 = [[JXShortDramaViewController alloc] init]; // 暂时注释掉影视(搜索)页签 // self.vc3 = [[SearchViewController alloc] init]; //我的 self.vc4 = [[MineViewController alloc] init]; GDNavigationController *nav1 = [[GDNavigationController alloc] initWithRootViewController:self.vc1]; GDNavigationController *nav2 = [[GDNavigationController alloc] initWithRootViewController:self.vc2]; // UINavigationController *nav3 = [[UINavigationController alloc] initWithRootViewController:self.vc3]; // 暂时注释 GDNavigationController *nav4 = [[GDNavigationController alloc] initWithRootViewController:self.vc4]; [nav1 setNavigationBarHidden:YES animated:NO]; [nav2 setNavigationBarHidden:YES animated:NO]; // [nav3 setNavigationBarHidden:YES animated:NO]; // 暂时注释 [nav4 setNavigationBarHidden:YES animated:NO]; NSArray *arrayVC = @[nav1, nav2, nav4]; // 首页、短剧、我的 [self setViewControllers:arrayVC]; for(int i=0;i