UITabBarItem does not update image

2019-09-15 11:58发布

问题:

For some reason, only one image of my UITabBarItem does not show up. This started to happen after I refactored the storyboards to organize them. When I run the app, no message is triggered to the debugger, it just don't show up. The image is being set in storyboard and nothing programmatically is being done to set it. It shows up in Interface Builder, but when I run the app it doesn't.

Already tried delete the image in catalog, rename it and perform clean up, but nothing helped.

回答1:

Few things to be tested.

  • Check the image that exists or not in the image assets.
  • check if you set the image from storyboard or not of the image and if you change the name in the assets catalog then you should change from story board too i am attaching the image too
  • .



    回答2:

    Maybe the UITabBarItem itself is overlapped with another object and it comes underneath this object so it's hidden. Make sure is it the image that doesn't show up or the UITabBarItem itself..hope it may help



    回答3:

    After I refactored my storyboards, for some reason, the Tab Bar from the storyboard with the problem was removed. That was enough to "hide" the image. Adding a new UITabBarItem on it's navigation controller and configuring the image there solved my problem.