I have an application with UITabbar
, I want to set image in Tabbar but am unable to set image in Tabbar. Instead of as it is image i get image shape in tint color, Is it possible to set image as it is in Tabbar? .
i have Tried this code but Unable to set image.
UITabBar *tabBar = self.tabBar;
UITabBarItem *targetTabBarItem = [[tabbar items] objectAtIndex:0]; // whichever tab-item
UIImage *selectedIcon = [UIImage imageNamed:@"name-of-selected-image.png"];
[targetTabBarItem setSelectedImage:selectedIcon];
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…