title: ScrollView to auto-resize its height according to content in a UIView?
body: <p>I need to auto-resize the height of a UIScrollView.Actually my ScrollView is in a UIView.
  In the UIView I have a label,UIButton, textField of static size.Now when the button is clicked some data gets loaded in the UITableView.The data in tableView is dynamic according to the no of objects in the array.</p>
  
  <p>To summarize :
  On viewLoad only label,textField,button gets loaded.
  After buttonClick tableView gets loaded .</p>
  
  <p>So I need to adjust the height of scrollView according to this criteria.But unable to do..</p>
  
  <pre><code>-(IBAction)buttonClick
  {
  
                  [testscroll setScrollEnabled:YES];
                  [testscroll setContentSize:CGSizeMake(320,90+[array count]*180)];
                  [self.view addSubview:testscroll];
    self.tableView=[[UITableView alloc] initWithFrame:CGRectMake(0,150,327,[array count]*180) style:UITableViewStylePlain];
                  self.tableView.delegate=self;
                  self.tableView.dataSource=self;
                  self.tableView.rowHeight=180;
                  self.tableView.scrollEnabled = NO;
                  [self.view addSubview:self.tableView];
                  [tableView release];
  
  }
  </code></pre>
  
  <p>I couldn't c d scrollView added on button click..How can I get it ?</p>