Help! My UITableView is the wrong size!
Is your UITableView too large for your UINavigationController? Is the content appearing behind your UITabBar? Then read on... :)
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;
}
Comments
by Henrik N on 2010-03-12 23:13:16
by reecon on 2010-06-15 07:59:13
by Accatyyc on 2010-09-21 13:44:59
by Bob Sellon on 2010-10-12 19:37:03
by Terry on 2011-01-19 20:15:27
by Tim Walsh on 2011-03-30 23:02:45
by omnia69 on 2011-07-09 12:37:45
by Ben on 2012-11-19 19:31:58