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
I found that if you mark the new view you will be pushing onto the navigation stack with the following line hides the tab bar as long as it is on the stack.
scrollViewController.hidesBottomBarWhenPushed = YES;
If you are using Interface Builder, ensure autoresizing is set properly in the Size Inspector. If you creating the UITextView in code, make sure you set the frame to be large enough and that the view's parent (and it's parent) are also large enough. For simplicity, add the view to the window directly, and then move inward from there.
To move a view to its superview:
- (void)moveViewToSuperview:(UIView *)view
{
UIView *newSuperview = [[view superview] superview];
[view removeFromSuperview];
[newSuperview addSubview:view];
[newSuperview bringSubviewToFront:view];
}
Try making the TabBarControllers view larger than the screen so that the tab bar is hidden off screen, as long as you do this before the new ViewController is set, then its view will resize to fill the new frame!
In my test I used the tabBarController:shouldSelectViewController: delegate method to check which view controller is about to become current and set the TabBarController.view.frame accordingly. For example:
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
if( viewController == second)
tabBarController.view.frame = CGRectMake( 0, 20, 320, 500);
else
tabBarController.view.frame = CGRectMake( 0, 20, 320, 460);
}
If this still isn't quite what you need, try looking into the hidesBottomBarWhenPushed property of UIViewController. When set to yes this will make the bottom bar hide if the Controller is pushed onto a Navigation stack.
Maybe there's another view that is a built-in part of the tab bar area? That is to say, something additional to hide. This will help you see what views are around.
for (UIView *viewy in [self.navigationController.view subviews])
{
NSLog([viewy description]);
}
I've experienced a similar issue, this discussion was helpful: UIWebView on iPad size
Tony's answer helped me discover that when you create a subview it's helpful to setup code similar to this:
self.tabBarController.tabBar.frame = self.view.bounds;
Add the extra amt of space to the dimension of the view, so if it was rectangle CGRectMake(0,0,320,460) make it CGRectMake(0,0,320,480)... This has happened to me, Im n ot exactly sure why, it might ahve to do with the underlying view you are putting your text view on top off, but just adding the dimension should do it