Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Navigation Bar on rotation

Tags:

cocoa-touch

I have a UIView with a navigation bar. How can I hide the navigation bar when the user puts the iPhone in landscape orientation, and have it show again on portrait view?

like image 860
Domness Avatar asked Jan 12 '09 18:01

Domness


1 Answers

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [[self navigationController] setNavigationBarHidden:UIInterfaceOrientationIsLandscape(toInterfaceOrientation) animated:YES];
    [[UIApplication sharedApplication] setStatusBarHidden:UIInterfaceOrientationIsLandscape(toInterfaceOrientation) animated:YES];
}
like image 116
adam Avatar answered Sep 25 '22 21:09

adam