如何在ipad monotouch应用程序中添加多个列?
问题描述:
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
答
在tableview中没有两列,而是可以在单柱自身添加子视图。
在你的cellForRowIndex委托做 在你的情况下,创建一个标签分配对应于该特定单元格的框架(x,y,宽度,高度)值。然后将此标签作为子视图添加到单元格中。现在为textfield相同的标签现在增加其x值更高,以便它将在tableview的权利。
嗨,我还是不清楚。什么是cellForRowIndex委托?你的意思是说我需要在表单中每个单元格的“GetCell”方法中添加一个标签和一个文本框,我们声明了单元格的内容? – Neha 2010-12-13 05:02:06