2010-12-10 41 views
0
I am using a UISplitViewController in my application. In this SplitViewController on the left hand side i have A NavigationController and on right side i have a DetailViewController. 

On my navigation controller i have UITableViewController which is used for navigating through the hierarchy of data. 

當我從表格中選擇一個記錄(單元格)時,我想在詳細視圖控制器上顯示其詳細信息。如何在ipad monotouch應用程序中添加多個列?

I want the data to be displayed in following format: 

Name:  Matthew 
Age:  24 
City:  Newyork 

My problem is, i dont know how to add more than one column in the UITableView. 

Another question is that how to edit the values from this table? 

I want to edit the cells from table. 

For example, i want to edit the details from above table to: 

Name: George Matthew 
Age:  24 
City: Newyork 


In short i want to place labels in the forst column and text boxes in the second column of my table. 

Please help me out. 

感謝, NEHA

回答

0

在tableview中沒有兩列,而是可以在單柱自身添加子視圖。

在你的cellForRowIndex委託做 在你的情況下,創建一個標籤分配對應於該特定單元格的框架(x,y,寬度,高度)值。然後將此標籤作爲子視圖添加到單元格中。現在爲textfield相同的標籤現在增加其x值更高,以便它將在tableview的權利。

+0

嗨,我還是不清楚。什麼是cellForRowIndex委託?你的意思是說我需要在表單中每個單元格的「GetCell」方法中添加一個標籤和一個文本框,我們聲明瞭單元格的內容? – Neha 2010-12-13 05:02:06

相關問題