如何在ipad monotouch应用程序中添加多个列?

时间:2010-12-10 08:06:50

标签: ipad uitableview xamarin.ios

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.

当我从表中选择记录(单元格)时,我想在详细视图控制器上显示其详细信息。

 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

1 个答案:

答案 0 :(得分:0)

在tableview中没有两列,但您可以在单列中添加子视图。

在你的cellForRowIndex委托中执行 在您的情况下,创建一个Label,指定与该特定单元格对应的框架(x,y,width,height)值。然后将此标签作为子视图添加到单元格中。现在,对于与label相同的文本字段,现在将其x值增加到更高,以便它将在tableview的右侧。