This one kicked my butt for a few hours today. I have my app structured using numerous XIB files and I have two possible root screens, one of which is the main one that loads in a UITabBarController which, in its first tab has a UIViewController with its own UIView which, in turn, has a UINavigationController whose view is a UITableView. The UINavigationController's view is added to the UIViewController's view as a subview. If you Google around, you'll find that when you start nesting these babies, you apparently start running into issues. Mine was that the UITableView was not displaying at the right height regardless of which component's settings I tweaked up the view hierarchy.
Very frustrating.
Of course, much Googling ensued and, finally, I stumbled upon this thread with the solution (a huge thank you to the poster nicknamed crinale). Note that I mentioned in the thread, I had to implement the fix in viewDidAppear: not in viewWillAppear::
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; CGRect frame = self.view.frame; frame.size.height = 367; self.view.frame = frame; }
The Help! My UITableView is the wrong size! article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.
Reached much the same solution, though I didn’t hardcode the value: http://gist.github.com/330916
Your post really helped me. I am developing UINavigationController based app and after adding bottom toolbar UITableView did not show properly last element, so I was trying to change table’s height which turned out to be quite tricky. Now it’s done, thanks!