将导航控制器添加到 iPhone 标签栏控制器
我有一个选项卡栏控制器并尝试向每个控件添加导航。在 xcode 3 中,我能够在属性检查中将控制器更改为导航控制器。我们如何在 xcode 4 中做到这一点?
I have a tabbar controllor and trying to add navigation to each control. In xcode 3 i was able to change the controllor to nav controllor in attribute inspection. How do we do that in xcode 4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有几种方法可以做到这一点。您可以在 IB 中执行此操作,也可以只为特定选项卡分配视图控制器。不。就做这些吧。
只需创建新类作为导航控制器的子类
转到 IB 中的特定选项卡,并将其类分配为其视图的相应类。
例如。对于选项卡 1,单击 tab1 并选择类作为
MyNavigationController
(它应该是UINavigationController
的子类)。There are a couple of ways to do this. You can either do it in the IB or just allocate a view controller for specific tabs. na. Just do these.
Just create new classes as a subclass of Navigation Controller
Go to the specific tabs in the IB, and assign their class as the respective class for it's view.
For example. For Tab 1, click tab1 and select the class as
MyNavigationController
(which should be a subclass ofUINavigationController
).我只需将导航控制器拖放到选项卡栏控制器即可获取支持导航的选项卡。然后设置适当的视图控制器类。
I just had to drag and drop the navigation controller to the tabbar controllor to get the navigation supported tab. Then set the appropriate view controller class.