问题描述
我必须开发一个具有多个屏幕的应用程序。我已经自动生成了xib文件,但对于我的其他屏幕,我需要另一个xib文件。如何创建另一个xib文件?
I have to develop an app with multiple screens. I have automatically generated xib file, but for my other screen I need another xib file. How do I create another xib file?
推荐答案
(假设XCode 4)
(Assuming XCode 4)
在文件 - >新文件...菜单对话框中,有一个名为用户界面的小节。
In the "File -> New File..." menu dialog, there is a subsection called "User Interface."
您将在说明中注意到每个子项,它都是An Interface Builder Document。这些是各种类型的笔尖。
You will notice in the description of each of the sub-items, it says "An Interface Builder Document." Those are various types of nibs.
如果你专门创建一个新的 ViewController
,你也可以选择Cocoa Touch部分并选择UIViewController子类项。下一页中有一个名为With XIB for User Interface的复选框。这将创建NIB以及相关的类文件。
If you're creating a new ViewController
specifically, you can also choose the "Cocoa Touch" section and select the "UIViewController subclass" item. There is a checkbox in the next page called "With XIB for User Interface." which will create the NIB as well as the associated class files.
这篇关于如何添加新的xib文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!