xcode 如何将使用 XIB 的项目转换为 Storyboard?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9458072/
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
How to convert a project using XIBs to Storyboard?
提问by Arne
I have some complex XIB files in a project using TabBarViewControllers containing navigation controllers. Since Xcode 4.2 I cannot edit those XIB files usefully anymore: the contained view controllers are invisible, only represented as grey boxes. It seems that in Storyboard projects this is the default, and the next layer in the storyboard shows the details of the contained views / view controllers. So how can I switch my project to use a storyboard instead?
我在一个使用包含导航控制器的 TabBarViewControllers 的项目中有一些复杂的 XIB 文件。从 Xcode 4.2 开始,我无法再有用地编辑这些 XIB 文件:包含的视图控制器是不可见的,仅表示为灰色框。似乎在 Storyboard 项目中这是默认设置,故事板中的下一层显示包含的视图/视图控制器的详细信息。那么如何将我的项目切换为使用故事板呢?
回答by DuckDucking
The objects are grayed out because of autolayout. Xcode understands that your controllers are not belonging to the current autolayout type.
由于自动布局,对象变灰。Xcode 知道您的控制器不属于当前的自动布局类型。
To make the objects active, select one by one, select the attributes editor (see picture) and at the end of it, see if there is a checked word installed
checked out. If there is more items them, delete all them and keep/add only the installed
one.
要使对象处于活动状态,请一个一个选择,选择属性编辑器(见图),然后在其末尾查看是否有选中的单词installed
。如果有更多项目,请删除所有项目并仅保留/添加installed
一项。