Я хочу изменить серый цвет по умолчанию на uitabbar, когда он не выбран. моя проблема в том, что я пробовал следующий код, но он показывает только серый цвет по умолчанию в первый раз, после чего он изменяет на требуемый белый оттенок цвета, который на самом деле является моим цветом изображений.изменить оттенок цвета по умолчанию uitabbar
в didFinishLaunchingWithOptions
[[tabBarController.tabBar.items objectAtIndex:0] setFinishedSelectedImage:nil withFinishedUnselectedImage:[UIImage imageNamed:@"mylib"]];
[[tabBarController.tabBar.items objectAtIndex:1] setFinishedSelectedImage:nil withFinishedUnselectedImage:[UIImage imageNamed:@"explore"]];
[[tabBarController.tabBar.items objectAtIndex:2] setFinishedSelectedImage:nil withFinishedUnselectedImage:[UIImage imageNamed:@"radio"]];
[[tabBarController.tabBar.items objectAtIndex:3] setFinishedSelectedImage:nil withFinishedUnselectedImage:[UIImage imageNamed:@"search"]];
[[tabBarController.tabBar.items objectAtIndex:4] setFinishedSelectedImage:nil withFinishedUnselectedImage:[UIImage imageNamed:@"people"]];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor whiteColor] }forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor colorWithRed:(191/255.0) green:(2/255.0) blue:(6/255.0) alpha:1] }forState:UIControlStateSelected];
[[UITabBar appearance] setTintColor:[UIColor colorWithRed:(191/255.0) green:(2/255.0) blue:(6/255.0) alpha:1]];
, пожалуйста, помогите я хочу избавиться от этого по умолчанию серый и хотите его белого цвета.
же проблема даже в viewdidload –
Убедитесь, что у вас есть этот новый пользовательский класс UITabBar как класс UITabBar в InterfaceBuilder. – rcat24