Reputation: 73
I am working on an app that uses tab bar for each view. (iphone app).
One of the view is a camera view where the user can take picture. Is there a way to hide the tab bar located bottom of the screen when the user changes to landscape mode? Then tab bar can reappear when it switches to portrait mode?
Thanks in advance.
Upvotes: 4
Views: 1959
Reputation: 91
if (toInterfaceOrientation == landscape)
self.tabBarController.tabBar.hidden = YES;
else
self.tabBarController.tabBar.hidden = NO;
Upvotes: 1
Reputation: 974
Use the UIViewControllers delegate method: - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
It will get called everytime the orientation changes. A simple if statement should then check and decide when to set the tabbar hidden like so:
pseudo code:
if (toInterfaceOrientation == landscape)
[[self tabbarcontroller]tabbar sethidden:YES];
else
[[self tabbarcontroller]tabbar sethidden:NO];
Upvotes: 4