简体   繁体   中英

Navigation Bar Item Image is not visible

I trying to implement a hamburger menu using a scroll view, two container views and two embedded views with Swift 2 and Xcode 7. Everything works but for some reason, I can't see the picture of the Navigation Item I set. However if I click on the area where the Item is supposed to be it responds as I expect. But I can't figure out why I can see the Nav bar item image?

Any idea what I am doing wrong? Thanks

Be sure that the image that you're trying to set is added to your project. Not the project folder but the actual Xcode project and used in the target that you're currently using. My guess is that you're setting the image with

UIImage(named:"YourImageName")

Also, another hint is that you can make your button visible.

Hope this helps.

I figured out my bug. I had copy a piece of code to create the menu image and paste it in a class with the same name. So the image was never created. But Xcode didn't complained that I have a nested class of the same name as the main class, that would have helped so much :-/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM