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:
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
Go to Assets folder. Select your tab image. On the right side under Attributes you will find "Render As". Select "Original Image".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With