单独的 xib 文件中的 IOS 选项卡栏
我是 ios 编程新手,我正在尝试做一些我认为非常简单但结果却相当困难的事情。我所做的是创建一个基于窗口的应用程序。然后我添加了一个 UIViewController 子类并检查“使用 xib 作为用户界面”。然后在我的主应用程序委托中,我将 IBOutlet 添加到创建的 UIViewController 子类中,并使其在应用程序运行时显示。然后在我的 mainwindow.xib 文件中,我将应用程序委托链接到我创建的 IBOutlet。现在,当我在该视图上放置标签并运行它时,它工作正常并显示我的标签。但是,我真的不确定如何让它显示选项卡栏控件。我添加了选项卡栏控件,但不确定之后要做什么。我尝试了很多事情但没有任何效果。如果有人有任何关于如何执行此操作的信息或我可能缺少的信息,请告诉我。
注意:我通过添加选项卡栏控件,然后在应用程序委托中添加 iboutlet 并在界面生成器中链接它们,使选项卡栏控件可以在基于窗口的应用程序中工作。但是,我不确定在使用不同的类时如何执行此操作。
任何帮助表示赞赏。
I am new to programming in ios and I am trying to do something that I would think would be pretty simple but is turning out to be quite a stuggle. What I have done is created a window based app. Then I added a UIViewController subclass and checked "with xib for user interface". Then in my main application delegate I added an IBOutlet to the UIViewController subclass created and made it show when the application runs. Then in my mainwindow.xib file I linked the application delegate to the IBOutlet that I created. Now when I put a label on that view and run it, it works fine and shows my label. However, I am really unsure of how to make it display the tab bar control. I added the tab bar control but am unsure what to do after that. I have tried many things but nothing worked. If someone has any information on how to do this or something I am probably missing let me know.
Note: I have gotten the tab bar control to work in a window based app by adding the tab bar control and then in the application delegate adding the iboutlet and linking them in interface builder. However, i am unsure how to do it when using a different class to do so.
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论