Reputation: 115
I have a tab bar which should have an image for the selected index.
Below is a sample-image which sould be used inside my tab bar.
I have added it by selecting the connected view controller assigned to the tab bar item and replacing the image. However this is what actually appears on the screen. The assigned graphics is not appearing on the tab bar.
Upvotes: 0
Views: 1772
Reputation: 2252
set your tabBarImage in assets folder, And set Render as original Image
Upvotes: 3
Reputation: 19156
Assets.xcassets
Attributes Inspector
Render As
value form Default
to Original Image
Upvotes: 4
Reputation: 20804
You can add this line self.tabBarItem.image = UIImage(named: "icono-menu")?.withRenderingMode(.alwaysOriginal)
in your item viewController
viewDidLoad
something like this
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.tabBarItem.image = UIImage(named: "icono-menu")?.withRenderingMode(.alwaysOriginal)
}
Upvotes: 1