简体   繁体   中英

All of my objects disappear in my iOS simulator, why is that?

I'm currently working with one navigation controller, and 3 view controllers. when i run my program, everything runs smooth, but none of my objects on my second and third view controller appear in the simulator ( labels, buttons, text fields etc.), how ever the navigation bar is there. why is that? how do i fix it?

For me, the issue was that I had added the button to the LaunchScreen.storyboard, instead of the Main.storyboard.

Credit to this post: http://discourse.djp3.net/t/first-ios-app-button-and-label-disappear-in-simulator/104/13?u=drazisil

Apparently it was an auto layout error. I removed auto layout and disabled size classes from my project and the simulator showed every object within the interface. I then enabled both auto layout and size classes once again & manually added my constraints instead of allowing Xcode to do it for me. Worked out fine once i ran the simulator again. I think this is a bug in Xcode's iOS sim.

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