I have an app that has a tab bar & nav bar for normal interaction. One of my screens is a large portion of text, so I allow the user to tap to go full screen (sort of l
You can definitely make something that appears correct by shifting the frame of the view such that the tab bar is off screen. I know someone else mentioned trying that, and you said it didn't work, but I suspect the issue is that you did not have the textviews resize mask setup properly when you tried. Below is code that should work:
- (void)viewDidLoad {
[super viewDidLoad];
currentlyHidden = NO;
}
- (void) hideStuff {
SO2AppDelegate *appDelegate = (id)[[UIApplication sharedApplication] delegate];
self.navigationController.navigationBarHidden = YES;
CGRect newFrame = appDelegate.tabBarController.view.frame;
newFrame.size.height += appDelegate.tabBarController.tabBar.frame.size.height;
appDelegate.tabBarController.view.frame = newFrame;
}
- (void) showStuff {
SO2AppDelegate *appDelegate = (id)[[UIApplication sharedApplication] delegate];
CGRect newFrame = appDelegate.tabBarController.view.frame;
newFrame.size.height -= appDelegate.tabBarController.tabBar.frame.size.height;
appDelegate.tabBarController.view.frame = newFrame;
self.navigationController.navigationBarHidden = NO;
}
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if (currentlyHidden) {
[self showStuff];
currentlyHidden = NO;
} else {
[self hideStuff];
currentlyHidden = YES;
}
}
Additionally, since this is definitely sensitive to how you have your nibs etc setup, I am posting a a project online so you can download it and get a look at it. It is a pretty minimal demo, just a Navigation based project where the delegate sets up a tab controller and embeds the view controller from the main nib. The rest is in the RootViewController nib and class. The bars are toggled whenever a touch begins, so just tap the screen. Obviously in a real app you might need to adjust the scroll view so stuff the content doesn't appear to jump.