ios - 标签栏 Controller 不显示栏按钮项目

标签 ios objective-c xcode6 uitabbarcontroller xcode-storyboard

我是 Objective-C 的新手,更多的是使用 Storyboard。话虽如此,我正在尝试在 UITabBarController 和 UINavigationController 中使用条形按钮项目,如下图所示。 enter image description here

但是一旦我在模拟器中运行该项目,该项目就不会显示。如果可能的话,我将不胜感激非编程解决方案。

enter image description here

最佳答案

好的,那么方法来做到这一点:

当您创建选项卡 View Controller 时。您必须添加一个导航 Controller 来处理每个选项卡。

选项卡 View Controller --> 导航 Controller --> View Controller 1.

然后将条形按钮项目添加到 View Controller 1。然后继续添加转场。

现在,还是不显示。

但是,如果您转到 View Controller 1 的代码:将条形按钮项目的 Storyboard 中的引用添加到 View Controller 1 文件中。然后,在 ViewWillAppear() 中:

self.tabBarController.navigationItem.rightBarButtonItem = _btnNewContact;

从那里,它会出现,并且您在 Storyboard中配置的转场应该可以完美运行! =)

关于ios - 标签栏 Controller 不显示栏按钮项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26576891/

相关文章:

ios - 缓存蓝牙连接 iOS

ios - XCode6 二进制文件无效,ITC 支持未提供详细信息

iphone - 图像未使用 UIImage drawInRect 缩放? (见附件代码)

iOS 关联域 - 子域似乎被忽略

python - 从 Objective-C 调用到 Python

ios - Xcode 6在打开使用Popover Segue的 Storyboard时崩溃

swift - 如何在 Swift 代码中将元组附加到数组对象?

iphone - 如何从pdf文件中的FileAttachment Annotation获取图像

android - 从现有后端创建 iOS 或 Android 应用程序

ios - 以编程方式向cgpointmake或cgpoint提供参数以从坐标对创建cgpoint