I am working on my first iPhone app, though I'm not a beginning programmer by any means I am new to the platform and Objective-C, so I am hitting some interesting bumps along the way.
Here's one that I hope someone has seen and can help me figure out what I'm doing wrong.
I have a Navigation Controller with a UITableView (subview) as my main view. I use both button locations on the Navigation Bar ("Edit" and "+"), so I've added a Toolbar and am displaying an "I" info button on the far right that allows me to show an application information screen.
When I press the "I" button, I animate the replacement of the UITableView with a UIWebView containing the Info screen; remove the "Edit" button; change the "+" button to a "Done" button and animate the removal of the Toolbar (more display room for the info page).
So far, so good.
When I press the "Done" button, I animate the UITableView back in; add the "Edit" button back to the Navigation Bar; replace the "Done" button with the "+" button and animate the Toolbar back with the "I" button in place.
Here's the problem.
The UITableView view region has now been clipped by the height of the Toolbar. Each time I run through this sequence, the view region shrinks again, until ultimately it's gone... I can still scroll through all of the entries in the table as long as I can see just one of them, but the white space below the table eventually grows and eats up the table one "Toolbar height" at a time.
Any ideas what I'm missing here?
All of this happens inside my RootViewController. The UITableView and UIWebView are separate subviews that are defined in the xib file and animated with removeFromSuperview and addSubview.
I remove and bring back the Toolbar changing the hidden attribute for
[self.navigationController setToolbarHidden:TRUE animated:TRUE]
Animating the toolbar in and out makes no difference, just simply hiding and showing it seems to be enough.
If I leave the Toolbar in place and don't remove and add it back, everything is fine, so it's the removal and replacement that's triggering the problem. I hate to leave the Toolbar in place simply because the extra space is nice to have in the information view - and because I hate having problems like this that I can't solve
Thanks,
-t