xcode 如何将初始视图添加到 Storyboard 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8252076/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:32:19  来源:igfitidea点击:

How to add initial view to Storyboard file?

iphoneiosxcodexcode4.2storyboard

提问by tarheel

I started an "Empty Application" template, this means that I had to add my own storyboard file. Problem is, it is completely blank, and I can't figure out how to get the first view on there, so I can start designing my interface.

我启动了一个“空应用程序”模板,这意味着我必须添加我自己的故事板文件。问题是,它完全是空白的,我不知道如何在那里获得第一个视图,所以我可以开始设计我的界面。

Anyone know how to get that first view on there?

有谁知道如何在那里获得第一个视图?

回答by Brayden

When you create a new Storyboard file, all you need to do is click/drag the UIViewController object from your right hand side of tools into your Storyboard and then you're all set to begin work on your new Storyboard.

当您创建一个新的 Storyboard 文件时,您需要做的就是从工具的右侧单击/拖动 UIViewController 对象到您的 Storyboard 中,然后您就可以开始在新的 Storyboard 上工作了。

回答by l_r

Just in case you can not start from scratch :

以防万一你不能从头开始:

  • Select your View Controller
  • Open the Attribute inspector(right pan by default)
  • Go to View Controllersection
  • Select Is Initial View Controllercheckmark of the Initial Scene option
  • 选择您的视图控制器
  • 打开属性检查器(默认为右平移)
  • 转到视图控制器部分
  • 选择初始场景选项的初始视图控制器复选标记

enter image description here

在此处输入图片说明