As per Apple docs
I\'m trying to set custom finished selected and unselected images on a UITabBarItem like so:
...
DetailViewController *vc1 = [[Det
The tab bar item is initialized with the method: initWithTabBarSystemItem:tag:
. But, as the documentation says:
This method returns a system-supplied tab bar item. The title and image properties of the returned item cannot be changed later.
You should initialize the tab bar item with initWithTitle:image:tag:
.
UITabBarItem *vc1i = [[UITabBarItem alloc] initWithTitle:@"Top Rated" image:nil tag:100];
[vc1i setFinishedSelectedImage:[UIImage imageNamed:@"tab_bar_item_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab_bar_item_normal.png"]];
If your are trying to achieve displaying of the actual image at the UITabBar then use the following code.
[yourTabBarItem setImage:[[UIImage imageNamed:@"more.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
and if you want to display image in original condition for the selected then use the following
[yourTabBarItem setSelectedImage:[[UIImage imageNamed:@"more.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
these two are alternative to
setFinishedSelectedImage: withFinishedUnselectedImage: