Home > database >  Get tab bar items in xcode to show in image original color as soon as the view is loaded
Get tab bar items in xcode to show in image original color as soon as the view is loaded

Time:01-10

Morning ya'll. I've designed a tab bar and managed to customise it with custom tab bar items but i can't figure out how you get the tab bar items to load in their original picture color when view is loaded. My code looks like this:

class GamePage: UIViewController {



override func viewDidLoad() {

    super.viewDidLoad()

    tabBarItem.image = tabBarItem.image?.withRenderingMode(.alwaysOriginal)

             tabBarItem.selectedImage = tabBarItem.selectedImage?.withRenderingMode(.alwaysOriginal)

    

}

which gives this outcome: enter image description here

  •  Tags:  
  • Related