简体   繁体   中英

Why Main.storyboard doesn't show?

I'm new to ios develop,I learned about storyboard recently and I'm trying to use it.But at last the storyboard file looks doesn't be loaded.

What I have done is:

1.add some ui elements like Button to initial xib file of storyboard

2.modify Main Interface in project - General page to Main .(my storyboard file name is Main.storyboard)

When I start the app,the screen is all white with nothing.Anyone can tell me why this happened and how can I solve this bug.Thanks!

Update1:As this image shows,I have set initial xib for storyboard.

  1. Since you said you didn't created the project with a storyboard template, look for this line in your info.plist info.plist中

  2. This could happen because the subview frames are being created outside the view frame. Try setting some alignment constraints in your subviews. 在此处输入图片说明

You have to set your controller as initial view controller. You can find it in your Main.Storyboard on the right site, if you select your first controller.

在此处输入图片说明

Here in 2021, a default Xcode project uses scenes, but that requires iOS 13 and I wanted to support iOS 12. I deleted the SceneDelegate file from my project and the scene delegate functions from the AppDelegate file, but then my storyboard wasn't loading either. The problem is that I also needed to remove the Application Scene Manifest section from info.plist.

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