Remove a toolbar when pushing a new view
Posted
by nevan
on Stack Overflow
See other posts from Stack Overflow
or by nevan
Published on 2010-05-18T11:44:06Z
Indexed on
2010/05/18
11:50 UTC
Read the original article
Hit count: 271
In the iPhone maps app there's a toolbar at the bottom of the map view (it contains the Search/Directions segment control and others). When moving from the map view by clicking on a callout, the toolbar slides out with the map view, leaving the next view (a table controller) with no toolbar.
I've tried to do the same thing with [self.navigationController setToolbarHidden:YES animated:YES]
in the second view controller, but this gives a strange toolbar sliding down animation, while the map view is sliding to the left.
Using [self.navigationController setToolbarHidden:YES]
in viewDidLoad:animated
also causes a bad effect (it makes the toolbar disappear the moment the push animation starts, leaving an ugly white space).
I'm assuming the answer to this is to use a nib file, but I'd prefer to do it programatically (if possible).
How can I get the toolbar to "stick" to the map view and slide out with it when I push a new view controller? Thanks.
© Stack Overflow or respective owner