XIB 文件像 XCode 中的 XML 一样打开,但可以使用 Interface Builder 正确打开

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

XIB File opens like an XML in XCode but opens correctly with Interface Builder

xcodeinterface-builderxcode4xib

提问by mabstrei

When I double-click my file StartWindow.xib in Xcode 4, it does not open into the integrated Interface Builder; it opens like a XML file. I can open all other xib files and they display as expected. I can open it with the old Interface Builder via "Open with".

当我在 Xcode 4 中双击我的文件 StartWindow.xib 时,它没有打开集成的 Interface Builder;它像 XML 文件一样打开。我可以打开所有其他 xib 文件,它们按预期显示。我可以通过“打开方式”用旧的界面生成器打开它。

What can I do to open it with the integrated Interface Builder?

我该怎么做才能使用集成的 Interface Builder 打开它?

采纳答案by Deepak Danduprolu

Go to the File Inspectorafter selecting the nib file. Under Identity and Type, select the drop down list for File Typeand choose the topmost element Default - com.apple....

File Inspector选择 nib 文件后转到。在 下Identity and Type,选择下拉列表File Type并选择最上面的元素Default - com.apple....

回答by jocull

Had this happen to me awhile ago. I had to go to File-> Close myfilename.xiband then reopen it before it would honor the file type. I think the shortcut is Ctrl + Cmd + W if you are looking at the file.

前段时间我遇到过这种情况。我不得不去File->Close myfilename.xib然后重新打开它,然后它才会尊重文件类型。如果您正在查看文件,我认为快捷方式是 Ctrl + Cmd + W。

回答by Sam Clewlow

I had this problem when I had the "Blame" view toggled on!

当我打开“责备”视图时,我遇到了这个问题!

回答by Leszek Zarna

In File Inspector right click on your xib and select Open As -> Interface Builder

在 File Inspector 中右键单击您的 xib 并选择 Open As -> Interface Builder

回答by Edwin Ikechukwu Okonkwo

This worked for me. i mistakenly got to the blame view when i had this issue,

这对我有用。当我遇到这个问题时,我错误地进入了责备观点,

but clicking on the "show standard editor" worked instantly

但是点击“显示标准编辑器”立即起作用

enter image description here

在此处输入图片说明

回答by Brian

I had the same problem recently, make sure you have selected the appropriate Editor view in the upper right hand corner, which would either be the Standard Editor or Assistant Editor. The Version Editor option will make the .xib file appear in its .xml form.

我最近遇到了同样的问题,请确保您在右上角选择了适当的编辑器视图,即标准编辑器或助理编辑器。版本编辑器选项将使 .xib 文件以其 .xml 形式出现。

回答by LokiDil

For me in Localization section nothing has added.

对我而言,本地化部分没有添加任何内容。

I had added a new localization English.

我添加了一个新的本地化英语。

Now XIB is shown properly.

现在 XIB 显示正确。