tags:

views:

975

answers:

2

I'm trying to hide my Navigation and Tool bars on tap. Similar to the way the Photos application works.

Any pointers would be greatly appreciated.

Thanks!

+5  A: 

Try to animate the y value of UINavigationBar and UIToolBar like this

[UIView beginAnimations: nil context:NULL];
[UIView setAnimationDuration:0.4];
[UIView setAnimationDelegate: self];
CGRect rect = self.navigationController.navigationBar.frame;
rect.origin.y = -40;
self.navigationController.navigationBar.frame = rect;
[UIView commitAnimations];

Hope this helps you too.

A.

Alberto
+3  A: 

This works too :)

[self.navigationController setNavigationBarHidden:YES animated:YES];
Chu Yeow
This seems to have the side effect of making the current view slide up along with the navigation bar. That's fine, but if you want the navigation bar to partially obscure the view, and then "slide out of the way", Alberto's answer does the trick.
Caffeine Coma