Is it possible to hide the tabbar when a button is pressed to allow a full screen view of the content?

I have a UITabBar in the detail view of my navigation based application. I am storing text and images in a tableview and would like the user to be able to tap on a cell to hide the navigation controller and the tabbar for full screen viewing of the content.

I found this code for hiding the top bars, but it does not seem as easy to hide the tabbar.

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
 [self.navigationController setNavigationBarHidden:YES animated:YES];

Does anyone know how to do this?

This code does not work to hide the tabBar once the view is already loaded.

  yourTabViewController.hidesBottomBarWhenPushed = YES;

This is the code I found. Seems to only work when the view is loaded though, so it can’t be used to hide the tabbar once it has already appeared. I’m still struggling to make this work. Please help!!!

    self.tabBarController.tabBar.hidden = YES;

Hide tabbar and navigationbar when view is tapped in monotouch

I need to be able to hide the navbar and tabbar when I tap on the view and show it again when tapped again. Is this possible in Monotouch?

Stop the Screen Locking when power button is pressed [duplicate]

Possible Duplicate: Overriding the power button in Android Is there any possible way I can stop the screen being locked when the power button is pressed.

Android – full screen transparent button

Is it possible to make a full screen button that is transparent so no matter where the user clicks the button is activated? Below is some basic java that shows a button and when pressed starts a new i

iphone+hide tabbar when any view is pushed

I am designing an app which has more than 4 options in tabbar,So all i want to do is to hide the tabbar when any view is being pushed and show it again when view is popped,I tried the hidesbottomwhenp

Remove/hide Full screen button from MPMoviePlayerController Standard Controls

I want to remove/hide the full screen button from MPMoviePlayerController standard controls as full screen mode is creating lot of problems and also not a requirement of my app.I just want the play,st

hide tabbar-issue

I’m having tabbar baseed application.. In my TabBar application i want to hide the tabbar when the 2nd view appear.In my second view having imageView with full sapce of that view (320*367) CGRect imag

hide custom tabbar when push

I have a customized tabbar in my app. I want to hide my tabbar when pushing another viewcontroller. Currently I implemented as this(The original tabbar has been hidden): myViewController.hidesBottomBa

Hide list view until button is pressed

Im having text box and list view and when you are pressing on the button you are the list view is filled with data ,currently the list view is under the button and the text box and always is there and

Set Toolbar position in View when hide the TabBar

I have an iPhone Application, that uses a Navigation controller and TabBar controller. In a first view, I show an a tableview, and when I click on first tableview cell, I set a new view with new Toolb

How to enter into “Full Screen Mode” in my Android App when pressed a toggle button to “ON”?

I am new to Android Development. – My requirement is that : My App should become full screen when i press the toggle button on my app to ON. – I did a lot of research and found that if we set the

Answers

The best workaround I have found is to change the view size so that it covers the tabbar. Here’s my code for hiding the statusBar, navBar, and tabBar when a row is selected:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

if (appDelegate.navigationController.navigationBar.hidden == NO)
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
    [appDelegate.navigationController setNavigationBarHidden:YES animated:YES];

    [UIView beginAnimations:@"HideTabbar" context:nil];
    [UIView setAnimationDuration:.2];
    self.view.frame = CGRectMake(0,0,320,480);
    [UIView commitAnimations];
}
if (appDelegate.navigationController.navigationBar.hidden == YES)
{
    [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
    [appDelegate.navigationController setNavigationBarHidden:NO animated:YES];

    [UIView beginAnimations:@"ShowTabbar" context:nil];
    [UIView setAnimationDuration:.2];
    self.view.frame = CGRectMake(0,0,320,368);
    [UIView commitAnimations];
}   
}

In order to adjust the size of your window, you first need to select the option of NONE in the status bar field, under your Attributes tab, of your Inspector window. Interface Builder will then let you change the size of your window.

There’s a built-in way to do this:

self.hidesBottomBarWhenPushed = YES;

But you have to do this BEFORE the view is pushed. This is how you might want to use that:

ChildViewController* childVC = [[ChildViewController alloc] init];
childVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:childVC animated:YES];
[childVC release];

My solution:

// Hide tab bar animated
CATransition *animation = [CATransition animation];
[animation setType:kCATransitionFade];
[[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; 
[self.tabBarController.tabBar setHidden:YES];

// Display tab bar animated
CATransition *animation = [CATransition animation];
[animation setType:kCATransitionFade];
[[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; 
[self.tabBarController.tabBar setHidden:NO];

You have to add #import <QuartzCore/QuartzCore.h>

I´ve found one answer to this issue, is very simple and effective.

The solution is to set the option “Hides Bottom Bar on Push” in ALL VIEWS, VIEW CONTROLLERS and TAB BAR CONTROLLERS of your app.

You can do this in IB or by code anyway.

Hope you this helps everyone…

In case any one needs the MonoTouch version os this cool little trick. (thanks!)

    // Method implementations
    static void hideTabBar (UITabBarController tabbarcontroller)
    {
        UIView.Animate(0.4, delegate() { 
            foreach(UIView view in tabbarcontroller.View.Subviews)
            {
                if(view.GetType()==typeof(UITabBar))
                    view.Frame=new  RectangleF(view.Frame.X, 480, view.Frame.Size.Width, view.Frame.Size.Height);
                else 
                    view.Frame=new  RectangleF(view.Frame.X, view.Frame.Y, view.Frame.Size.Width, 480);
            }
        });
    }

    static void showTabBar (UITabBarController tabbarcontroller)
    {
        UIView.Animate(0.4, delegate() { 
            foreach(UIView view in tabbarcontroller.View.Subviews)
            {
                if(view.GetType()==typeof(UITabBar))
                    view.Frame=new  RectangleF(view.Frame.X, 367, view.Frame.Size.Width, view.Frame.Size.Height);
                else 
                    view.Frame=new  RectangleF(view.Frame.X, view.Frame.Y, view.Frame.Size.Width, 367);
            }
        });
    }