将新选项卡添加到选项卡栏控制器 [英] Adding new tabs to a tab bar controller

查看:124
本文介绍了将新选项卡添加到选项卡栏控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个标签栏iOS应用。标签栏视图控制器有两个选项卡,每个选项卡都连接到一个视图控制器。

I am creating a tab bar iOS app. The tab bar view controller has two tabs, each of them connected to a view controller.

它的外观如下:

我需要向选项卡控制器添加更多选项卡。我在故事板上做的如下:

I need to add more tabs to the tab controller. I am doing it at the storyboard as follows:


  1. 我添加了一个新的视图控制器。

  2. 我控制 - 从标签栏控制器拖动到新创建的视图控制器。

  3. 打开一个窗口,我选择关系Segue-View控制器。

  4. 从标签栏控制器到新视图控制器的segue已创建。

  1. I add a new view controller.
  2. I control-drag from the tab bar controller to the new created view controller.
  3. A window opens and I select Relationship Segue-View Controller.
  4. The segue from the tab bar controller to the new view controller is created.

我认为这是做到这一点的方法,但之后标签栏控制器没有显示任何标签图标,标签栏变为灰色。

I think that is the way to do it, but after that the tab bar controller doesn't show any tab icons, the tab bar becomes grey.

喜欢这样:

我需要知道我做错了什么。

I need to know what am I doing wrong.

推荐答案

首先从对象库中拖动一个TabBarController你会看到只有两个带有VC的标签。

First drag A TabBarController from Object Library you see that only two tabs with thier VC there.

在TabBarVC中添加更多Tab项目从对象库拖动VC

to add more Tab Item in TabBarVC drag VC from Object Library

然后控制从TabBarVC拖动到新VC然后Segue关系弹出窗口

Then Control drag from TabBarVC to Newly VC then Segue relation pop ups

选择最后一个关系 Segue - > 查看控制器

Select last one Relationship Segue -> View Controllers

这篇关于将新选项卡添加到选项卡栏控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆