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?
Edit: Here are some screen shots to show what I mean...
What I get if the NIB DetailFooterView is generously sized to begin with.
What I get if the NIB is smaller to begin with. The Entire text is there if you push up but it bounces back to this.
What I'd like to have all the time no matter what the size of the text in the footer.
Cheers & TIA, Pedro :)