为什么我的视图不会出现在故事​​板中并且在左侧窗格中显示为灰色? [英] Why don't my views show up in Storyboards and are greyed out in the left pane?

查看:138
本文介绍了为什么我的视图不会出现在故事​​板中并且在左侧窗格中显示为灰色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是在故事板中遇到一个奇怪的错误。

I am experiencing a weird bug in Storyboards.

我用原型单元设置 UITableViewController 并设置一些自动布局约束。一切都很好,直到这里。

I set up a UITableViewController with prototype cells and set some autolayout constraints. Everything fine until here.

然后,我不得不将整个项目目录移动到另一个文件夹中。这是一个正常的操作我认为不应该导致任何问题,因为应用程序和所有文件几乎都是自包含的。

Then, I had to move the whole project directory into another folder. This is a normal action I believe that shouldn't lead to any problems since the app and all the files are pretty much self-contained.

但是,因为我移动了项目, UITableView 中的原型单元格在我的故事板中显示为空,但子视图仍显示在左侧窗格中所有场景中和视图显示...只是他们是灰色的(见截图)...有谁知道这意味着什么?我也查看了Storyboard文件的XML,但在那里一切似乎都很正常......

However, since I moved the project, the prototype cells in the UITableView are shown empty within my Storyboard, but the subviews are still showing up in the left pane where all the scenes and views are shown... Only that they are greyed out (see the screenshot)... Does anyone know what this means? I also looked into the XML of the Storyboard file, but everything seemed normal to me in there...

有什么想法吗?

编辑:奇怪的是,自定义类中的 IBOutlets 仍然设置并链接到故事板中的视图。 ..但只在左侧窗格中,而不是在故事板本身。

Strange thing also is that the IBOutlets from the custom classes still are set and link to the views in the storyboard... but only in the left pane, not in the storyboard itself.

推荐答案

我自己找到了一个答案,那是因为<移动项目后强>大小类被重置 ...

Just found an answer myself, it was because Size Classes were reset after I moved the project...

当视图仅为视图设置时,灰显视图是Xcode的标准行为当前未选中的特定尺寸类!

我已为我的 UIViewController 到紧凑 - 任何,这就是它处于正确状态的样子:

I had set the size classes for my UIViewController to Compact - Any, this is what it looks like in proper state:

出现问题我将大小类更改为另一个(例如任意 - 任何):

The problem occurs when I change the size classes to another one (e.g. Any - Any):

这篇关于为什么我的视图不会出现在故事​​板中并且在左侧窗格中显示为灰色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆