This problem comes when I build an app targeting iOS 5 or 6, but run it on iOS 7. If I have a controller in a navigationController that is a part of a tabBarController, and I do the following:
controller.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:testController animated:YES];
A strange vertical positioning animation occurs. I would instead like the new controller (with the bottom bar hidden) to push or pop on the navigation controller pushing the tab bar out or bringing it back and with no vertical positioning changes.
Video of Issue: http://cl.ly/1w0g3j293m03
Open Radar Report: http://www.openradar.me/14670329
You can always remove animation from the UIView with
[self.view.layer removeAllAnimations];
Cheers
Try This:
[self.navigationController.navigationBar setHidden:NO];
If you want to keep transparency, add this to the root UIViewController
:
- (void)viewWillAppear:(BOOL)animated {
[UIView animateWithDuration:0.35f animations:^{
self.tabBarController.tabBar.alpha = 1.0f;
}];
}
- (void)viewWillDisappear:(BOOL)animated {
[UIView animateWithDuration:0.35f animations:^{
self.tabBarController.tabBar.alpha = 0.0f;
}];
}
This way you'll get a nice fade-in/fade-out animation of the tab bar.
Try this
if( [self respondsToSelector:@selector(setEdgesForExtendedLayout:)] )
{
self.edgesForExtendedLayout=UIRectEdgeNone;
}
this says you should put:
self.navigationController.navigationBar.translucent = NO;
follow this link
Just set the translucent property to NO for both navigation bar and tabBarController. This will solve your problem.