# customTabBar **Repository Path**: rang/custom-tab-bar ## Basic Information - **Project Name**: customTabBar - **Description**: 自定义tabbar - **Primary Language**: Objective-C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-05-02 - **Last Updated**: 2021-05-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # customTabBar #### 介绍 自定义tabbar #### 使用说明 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = UIColor.whiteColor; BaseTabBarController *tabBarController = [[BaseTabBarController alloc] init]; tabBarController.items = [self getTabBarItemList]; self.window.rootViewController = tabBarController; [self.window makeKeyAndVisible]; return YES; } - (NSArray *)getTabBarItemList{ NSMutableArray *arr = [NSMutableArray arrayWithCapacity:0]; UIColor *norTxtColor = [UIColor colorFromHexRGB:@"4CAF50"]; UIColor *selTxtColor = [UIColor whiteColor]; BarItemModel *itemModel = [[BarItemModel alloc] init]; itemModel.title = @"早盘资讯"; itemModel.normalColor = norTxtColor; itemModel.selectedColor = selTxtColor; itemModel.selectedImage = @"zp_sel"; itemModel.normalImage = @"zp_nor"; itemModel.viewController = [[ZpViewController alloc] init]; [arr addObject:itemModel]; itemModel = [[BarItemModel alloc] init]; itemModel.title = @"价投"; itemModel.normalColor = norTxtColor; itemModel.selectedColor = selTxtColor; itemModel.selectedImage = @"worth_sel"; itemModel.normalImage = @"worth_nor"; itemModel.viewController = [[UIViewController alloc] init]; [arr addObject:itemModel]; itemModel = [[BarItemModel alloc] init]; itemModel.title = @"诊股"; itemModel.normalColor = norTxtColor; itemModel.selectedColor = selTxtColor; itemModel.selectedImage = @"diag_sel"; itemModel.normalImage = @"diag_nor"; itemModel.viewController = [[UIViewController alloc] init]; [arr addObject:itemModel]; itemModel = [[BarItemModel alloc] init]; itemModel.title = @"业绩预告"; itemModel.normalColor = norTxtColor; itemModel.selectedColor = selTxtColor; itemModel.selectedImage = @"achieve_sel"; itemModel.normalImage = @"achieve_nor"; itemModel.viewController = [[UIViewController alloc] init]; [arr addObject:itemModel]; return arr; } #### 效果图 ![输入图片说明](https://images.gitee.com/uploads/images/2021/0503/000924_c416a34f_356484.png "Simulator Screen Shot - iPhone 11 Pro - 2021-05-03 at 00.07.07.png")