ios - 在 swift : how to add tab bar icons to a regular ViewController storyboard?

标签 ios iphone xcode swift

我想添加两个标签栏图标(表格 View 和 Collection View ),如下面第一张图所示,到常规的 ViewController Storyboard(如下面第二张图所示)。

Tab bar icons

regular ViewController

我试图将 ViewController 嵌入 TabBarController(编辑器 -> 嵌入 -> 标签栏 Controller ),但在我看来 xcode 只允许我添加一个图标(标签栏项目)。

最佳答案

Storyboard中的每个选项卡都需要一个 View Controller ,然后使用“关系转场”、“ View Controller ”将选项卡 View Controller 连接到这些 Controller (按住 Ctrl 从选项卡 View Controller 拖动到目标 Controller ,然后选择它)。

然后在每个 Controller 中,您可以单击选项卡项并在属性中设置图像。

关于ios - 在 swift : how to add tab bar icons to a regular ViewController storyboard?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31620376/

相关文章:

ios - 试图导出到 csv 但我如何从委托(delegate)中实现?

ios - iOS 7上UITableView行删除动画闪烁

ios - 首次运行时未调用 didUpdateLocations

ios - 为什么我的 unwind segue 回溯得太远了?

ios - ionic Cordova 使用媒体插件在 IOS 上录制音频失败

iPhone (iOS) 应用程序使用本地 sqlite 并希望在多个设备之间同步

iphone - UIpickerView 在同一个 ScrollView 中填充多个 uitextFields

ios - 在我将我的 IOS 应用程序提交到 AppStore 后,AdMob 没有显示广告

ios - 新的 ios 应用程序在上传后不会显示在 itunes connect 上

objective-c - iPhone应用程序中的didReceiveMemoryWarning中的消息