PDA

View Full Version : About adding controls in UITableView




iphonejudy
Sep 25, 2008, 07:08 AM
Hi,


I want to add button in the UITableView,

1) Can i add controls in the UITableView?

2)If so,How Can we do?,What is the code we have to use for that?

Can anybody please tell me ?


Thanks
judy



caldwelljason
Sep 25, 2008, 12:28 PM
Depends on what you mean by adding controls in UITableView.

The simplest answer is that you can add any control you want to a UITableView cell by calling cell.contentView addSubView:myControl.

You can also add controls to the header and footer cells of a table, using similar code.

Hope that helps!

iphonejudy
Sep 26, 2008, 02:52 AM
:apple:
Hi,Thanks for ur reply

I want to add a button in the UITableView,
Can i have a brief code for that?

Thanks
judy

Niiro13
Sep 26, 2008, 11:49 AM
:apple:
Hi,Thanks for ur reply

I want to add a button in the UITableView,
Can i have a brief code for that?

Thanks
judy

You're still not entirely clear :P. Did you mean in the TableView or in one of the cells? If it's in the tableview, you'd need to do something like [self.view addSubview:button]. If it's in the cell then you'd need to do something like [cell addSubview: button].

firewood
Sep 26, 2008, 12:36 PM
Check the UICatalog example for code that does exactly that.