views:

17

answers:

1

I have a scrollview that contains a tableview and some other componinets, some buttons and labels. However I cannot figure out how the following two questions are addressed:

  1. I know how to disable the scrolling in the tableview. Nevertheless, can anyone tell me how to expand the tableview programmatically so the hight of the table view will not only be limited to the hight I set in interface builder?
  2. When it comes to deciding the contentSize of the scrollview, how do I calculate the hight of the tableview as a whole?

Thank you in advance for any thoughts.

+1  A: 

You can set the tableView's frame and adjust the height with:

[tableView setFrame:CGRectMake(x, y, width, height)];

You can get the size of the table with:

tableView.frame.size

Reading up on CGRect will help you understand how to access the information you want from the frame or bound of a view.

charlie hwang