.
- , , .
, .
, :
#define kTabBarHeight 49 // This may be different on retina screens. Frankly, I have not yet tried.
- (void) hideTabBar:(BOOL)hide {
AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
CGRect bounds = [UIScreen mainScreen].bounds;
float width;
float height;
width = bounds.size.width;
height = bounds.size.height;
if (hide) {
[self.tabBarController.tabBar setHidden:YES];
switch (delegate.tabBarController.interfaceOrientation) {
case UIInterfaceOrientationPortrait:
[self.tabBarController.view setFrame:CGRectMake(0,0,width,height+kTabBarHeight)];
break;
case UIInterfaceOrientationPortraitUpsideDown:
[self.tabBarController.view setFrame:CGRectMake(0,-kTabBarHeight,width,height+kTabBarHeight)];
break;
case UIInterfaceOrientationLandscapeLeft:
[self.tabBarController.view setFrame:CGRectMake(0,0,width+kTabBarHeight,height)];
break;
case UIInterfaceOrientationLandscapeRight:
[self.tabBarController.view setFrame:CGRectMake(0-kTabBarHeight,0,width+kTabBarHeight,height)];
break;
default:
break;
}
} else {
[self.tabBarController.view setFrame:CGRectMake(0,0,width,height)];
[self.tabBarController.tabBar setHidden:NO];
}
return;
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
[self hideTabBar:YES];
}
- (void)viewWillAppear: (BOOL)animated {
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
[self hideTabBar: YES];
return;
}
- (void)viewWillDisappear: (BOOL)animated {
[self hideTabBar:NO];
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
return;
}
. , , .
, , .
1. , , , .
2. , , , . , . . .
I will keep you posted as soon as I find solutions to these small but unpleasant mistakes.
source
share