Reputation: 6580
I'm trying to assign a custom image to UITabBarItem in storyboard. Unfortunately, it shows me an box instead of an image.
Here's my PNG image
Storyboard:
How it appear in simulator:
Upvotes: 4
Views: 7125
Reputation: 319
Go to Assets folder. Select your tab image. On the right side under Attributes you will find "Render As". Select "Original Image".
Upvotes: 2
Reputation: 6580
As it turned out in order do display an actual image following code should be executed.
[self.activityItem setImage:[[UIImage imageNamed:@"activity.png"]
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
Note the Rendering Mode of UIImage. You can find more about it UITabBar Reference Thanks to @ Vladislav Kovalyov
Upvotes: 6