2010-12-10 3 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. 

Спасибо, Неху

ответ

0

В Tableview нет двух столбцов, но вместо этого вы можете добавить подвидов в самой одной колонке.

Сделайте в своем деле делегат cellForRowIndex В вашем случае создайте метку, назначив значения фрейма (x, y, ширина, высота), соответствующие этой конкретной ячейке. Затем добавьте эту метку в качестве поднабора в ячейку. Теперь для текстового поля, такого же, как label, теперь увеличьте его значение x выше, чтобы оно было на стороне tableview.

+0

Привет, я еще не понял. Что такое делегат cellForRowIndex? Вы хотите сказать, что мне нужно добавить ярлык и текстовое поле в каждой ячейке таблицы в методе «GetCell», где мы объявляем содержимое ячейки? – Neha 2010-12-13 05:02:06

Смежные вопросы