Xcode 8.1 故事板仅显示蓝线

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40301394/
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-15 09:30:40  来源:igfitidea点击:

Xcode 8.1 storyboard showing blue lines only

xcodestoryboardxcode8

提问by Majid Bashir

I installed Xcode 8.1 and the storyboard shows only blue lines, for all UI elements. If someone has figured it out let me know. I am unable to revert it to even Xcode 8.0.

我安装了 Xcode 8.1,故事板仅显示所有 UI 元素的蓝线。如果有人弄清楚了,请告诉我。我什至无法将其恢复为 Xcode 8.0。

回答by Rajan Maheshwari

Ok, So finally I too got the blue line problem in Xcode 8.1

好的,最后我也遇到了Xcode 8.1 中的蓝线问题

Here is the screenshot

这是屏幕截图

Xcode screenshot of interface builder issue

界面构建器问题的 Xcode 屏幕截图

We can see the error message:

我们可以看到错误信息:

An internal error occurred. Editing functionality may be limited

发生了内部错误。编辑功能可能受限

with a Report a Bugbutton on the right side.

右侧有一个报告错误按钮。

Don't know why it happened. But I just quit Xcode and Simulator and restarted it. That fixed it and I got the UI elements back.

不知道为什么会这样。但我只是退出 Xcode 和 Simulator 并重新启动它。这修复了它,我得到了 UI 元素。

回答by Bhavi Lad

Don't worry revert back to old xcode

不要担心恢复到旧的 xcode

To remove the blue lines,

要删除蓝线,

First, select a view controller in the storyboard.

首先,在故事板中选择一个视图控制器。

Then, go to Editor > Canvas > Show Bounds Rectangles

然后,转到编辑器 > 画布 > 显示边界矩形

This will hide the blue lines.

这将隐藏蓝线。

You may have to repeat this 2 or 3 times to make it work.

您可能需要重复此操作 2 或 3 次才能使其正常工作。

Image Link

图片链接

回答by Jiebe

I had this same issue when I had upgraded to Mojave and then installed an older Xcode (10.1) version. To fix I deleted all Xcode (10.2/10.1) versions and then installed Xcode 10 and it fixed the issue.

当我升级到 Mojave 然后安装旧的 Xcode (10.1) 版本时,我遇到了同样的问题。为了修复,我删除了所有 Xcode (10.2/10.1) 版本,然后安装了 Xcode 10 并解决了该问题。

回答by GKK

Seeing the blue rectangles is actually a feature of Xcode editor. You can turn this On/Off by going to Editor menu->Canvas->Show Bounds Rectangles

看到蓝色矩形实际上是 Xcode 编辑器的一个功能。您可以通过转到编辑器菜单->画布->显示边界矩形来打开/关闭此功能

But yes, seeing just the blue boxes seems to be a bug. Usually happens if you have been switching between various versions of Xcode frequently. I guess quitting and reopening Xcode shall resolve this temporary issue.

但是,是的,只看到蓝色框似乎是一个错误。如果您经常在不同版本的 Xcode 之间切换,通常会发生这种情况。我想退出并重新打开 Xcode 应该可以解决这个临时问题。

回答by EarlybirdAdam

This has happened to me on several occasions. For me it almost always occurred after dragging a UILabelfrom a UITableViewCellinto a different view.

这在我身上发生过好几次。对我来说,它几乎总是发生在将 aUILabel从 aUITableViewCell拖入不同的视图之后。

I was able to fix the problem by deleting the view controller in the storyboard that I did the dragging to/from, closing the app, and reopening the project.

我能够通过删除故事板中的视图控制器来解决这个问题,我进行了拖动,关闭应用程序,然后重新打开项目。

回答by svenson95

I had a similar problem in XCode 11, in my case even the view controllers was completely black. The problem was a Custom Class assigned to an UIButton. After a while i deleted the class because i didn't need it anymore, but the Button still had the class assigned.

我在 XCode 11 中遇到了类似的问题,在我的情况下,甚至视图控制器都是完全黑色的。问题是分配给 UIButton 的自定义类。过了一会儿,我删除了这个类,因为我不再需要它了,但是 Button 仍然分配了这个类。

Open the particular storyboard file, delete the assignment in Identity Inspector, restart Xcode. This fixed it for me.

打开特定的故事板文件,删除 Identity Inspector 中的分配,重新启动 Xcode。这为我修好了。

回答by Lautert

Had a similar issue (only blue lines without details rendering) when upgrading Xcode without restarting the Mac. Killing the simulator fixed it:

在不重新启动 Mac 的情况下升级 Xcode 时遇到了类似的问题(只有蓝线没有细节渲染)。杀死模拟器修复了它:

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService