2012-06-18 63 views
11

所以我最初開始於iOS 5 基於標籤的應用程序模板,我已經迷上了兩個意見一個標籤欄,但是當我去添加一個表視圖控制器到第一個viewcontroller,它不會讓我。如何將表視圖控制器添加到基於標籤的應用程序的Xcode 4.3.3

我對我應該怎麼解決這個有點糊塗了?我必須用代碼來完成嗎?或者有沒有辦法以圖形方式做到這一點?在故事板 enter image description here

回答

34

查看嵌入並不簡單。

首先,刪除First View Controller

Storyboard without First View Controller

現在,拖動一個新Table View Controller到故事板:

Storyboard with Table View Controller

最後,創建Tab Bar Controller和新Table View Controller之間的關係。

選擇Tab Bar Controller,然後按Control鍵,將鼠標拖動到Table View Controller,然後用鼠標放開。在彈出的對話框中選擇Relationship - View Controllers

enter image description here

現在新Table View Controller應原Tab Bar Controller內是一個標籤。

enter image description here

+2

謝謝!那就是訣竅。我很欣賞您拍攝截圖的時間! – khaliq

+0

仍然適用於Xcode 7。 – leanne

0

在Xcode中8,表視圖將成爲所述拖動和選擇的關係後完全藍色。只需點擊藍色表格視圖的底部,然後在attributes inspector中選擇一個system item,一切都會好起來的。

相關問題