【问题标题】:How to add more than one column in ipad monotouch application?如何在 ipad monotouch 应用程序中添加多个列?
【发布时间】:2010-12-10 08:06:49
【问题描述】:
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.

谢谢, 尼哈

【问题讨论】:

    标签: ipad uitableview xamarin.ios


    【解决方案1】:

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

    在你的 cellForRowIndex 委托中做 在您的情况下,创建一个标签,分配与该特定单元格对应的 frame(x,y,width,height) 值。然后将此标签作为子视图添加到单元格中。现在对于与标签相同的文本字段,现在将其 x 值增大,使其位于 tableview 的右侧。

    【讨论】:

    • 嗨,我还是不清楚。什么是 cellForRowIndex 委托?你的意思是说我需要在我们声明单元格内容的“GetCell”方法中的表格的每个单元格中添加一个标签和一个文本框吗?
    • 我需要为这个表创建一个单独的类文件,还是我可以在我的 DetailViewcontroller.cs 文件本身中为这个表创建一个子类?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-21
    • 1970-01-01
    • 1970-01-01
    • 2011-11-06
    相关资源
    最近更新 更多