How do I resize table view after resizing it's footer?
- by Pedro
I have a UITableView with header & footer added with code following the pattern shown in Apple's recipes example so the code for the footer is...
if (tableFooterView == nil) {
[[NSBundle mainBundle] loadNibNamed:@"DetailFooterView" owner:self options:nil];
self.tableView.tableFooterView = tableFooterView;
}
The footer NIB contains nothing more than a UITextView & I set text & resize with...
CGSize size = [footerText sizeWithFont:[footerTextView font] constrainedToSize:CGSizeMake(304.0, 500.0)];
CGRect frame = CGRectMake(8.0, 0.0, size.width, size.height + 24.0);
footerTextView.frame = frame;
footerTextView.text = footerText;
[tableFooterView sizeToFit];
That all works however I can't get the UITableView to resize around the resized footer. If I set the original size of the footer for any possible text I have a big whitespace in most cases. If I set it smaller then I can push the view up to see the whole text but it bounces back on release. I've tried [[self view] sizeToFit]; but that doesn't work. Can anyone fill me in?
Cheers & TIA, Pedro :)