PDA

View Full Version : How to set the position of the UITableView on the screen?




lesliekkwu
Jan 6, 2009, 09:11 AM
I would like to ask how should I set the position of the UITableView on the screen.

Did some googling but it seems not work...I use the following

tblView = [[UITableView alloc] initWithFrame:CGRectMake(0.f, 250.f, 321.f, 100.f)];

Using the above, I cannot drag a tableview on the IB. Also, I don't see any of my cell contents appear.

Any help will be greatly appreciated.

Cheers,

Leslie



dejo
Jan 6, 2009, 11:13 AM
I would like to ask how should I set the position of the UITableView on the screen.

Did some googling but it seems not work...I use the following

tblView = [[UITableView alloc] initWithFrame:CGRectMake(0.f, 250.f, 321.f, 100.f)];

Using the above, I cannot drag a tableview on the IB. Also, I don't see any of my cell contents appear.
I think you are a little confused. You cannot add a tableView programatically and then manipulate it via IB. You must either add it in the code or add it via IB. (You can, however, manipulate it in the code once it's been added in IB, assuming you have your connections set up correctly).