Asanka Madushan
Asanka Madushan

Reputation: 473

Icons displaying in selected state in more tabbar controller IOS8

I am using a tab bar controller in my app, and I have more tab bar view controllers. In iOS 8 icons that are assigned to tabs in more tab bar are always in selected(Blue) state, which worked fine in iOS7?

image = [UIImage imageWithContentsOfFile:imagePath];
UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTitle:title image:image tag:tag];

enter image description here

Upvotes: 0

Views: 112

Answers (1)

Ilario
Ilario

Reputation: 6079

you can try with following code:

UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];

[tabBarItem1 setImage:[[UIImage imageNamed:@"tab1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[tabBarItem1 setSelectedImage:[[UIImage imageNamed:@"tab1Selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[tabBarItem1 setTitle:title];

and you can do the same things with other tabs

Upvotes: 0

Related Questions