我的当前选项卡栏如下所示:
我的代码如下:
-(void)startTabBar{
self.tabBarController = [[UITabBarController alloc] init];
TAB_1 *tab_1 = [[TAB_1 alloc]init];
TAB_2 *tab_2 = [[TAB_2 alloc]init];
TAB_3 *tab_3 = [[TAB_3 alloc]init];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName,nil] forState:UIControlStateSelected];
NSArray* controllers = [NSArray arrayWithObjects:tab_1,tab_2, tab_3, nil];
self.tabBarController.viewControllers = controllers;
self.window.rootViewController = self.tabBarController;
}
我想要做的是:
普通选项卡:选项卡的标题应该像黑色一样,但只有图标图像应该是黑色。期望的选项卡应该是这样的:
选中选项卡:选项卡的标题应该像红色一样,但只有图标图像应该是红色。期望的选项卡应该是这样的:
选项卡栏颜色:使整个选项卡栏颜色更透明,颜色相同。
有人可以帮忙吗?