xcode 如何将 Storyboard 作为 xml 源打开?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30567998/
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 open Storyboard as xml source?
提问by new2ios
I need to reorder View controllers
in my Storyboard
. I know that I need to open Storyboard
as source code using right clicking on the file and using menu Open as...
. Then I can open Storyboard
as xml
file.
我需要View controllers
在我的Storyboard
. 我知道我需要Storyboard
使用右键单击文件并使用 menu 作为源代码打开Open as...
。然后我可以Storyboard
作为xml
文件打开。
My problem is sometimes the source is opened as text - there are no colour differences on the comments for example. Also when I make move of the code inside it is not indented properly.
我的问题是有时源作为文本打开 - 例如,评论没有颜色差异。此外,当我移动里面的代码时,它没有正确缩进。
How to open Storyboard
source as xml
?
如何Storyboard
开源xml
?
回答by Michelle
To open Storyboard as XMl source:
要将 Storyboard 作为 XML 源打开:
Right click on your storyboard, you will see a menu, hover over "Open As"then select "Source Code"
右键单击您的故事板,您将看到一个菜单,将鼠标悬停在“打开为”上,然后选择“源代码”
Hope this will help.
希望这会有所帮助。
To go back to view storyboard in the design build mode,
要在设计构建模式下返回查看故事板,
Right click on your storyboard, you will see a menu, hover over "Open As"then select "Interface Builder -- Storyboard"
右键单击您的故事板,您将看到一个菜单,将鼠标悬停在“打开为”上,然后选择“界面生成器 -- 故事板”
回答by Naren
If Xcode can't open the file .nib or .storyboard ( may be because of merge conflict ) then you can open in textEdit
如果 Xcode 无法打开文件 .nib 或 .storyboard(可能是因为合并冲突),那么您可以在 textEdit 中打开
open -a textEdit
打开 -a 文本编辑