tags:

views:

210

answers:

3

Hello Everyone,

My app flow requires Navigation and TabBar controller. So I decided to use TabBar template. Since my first page is login which do not require TabBar, I used presentModelViewController to show Login screen which have Navigation bar if user Navigate to Forgot password.

LoginView *rootView = [[[LoginView alloc] init] autorelease];
navigationController= [[[UINavigationController alloc] initWithRootViewController:rootView] autorelease];

[tabBarController presentModalViewController:navigationController animated:FALSE];

Ones the user login I dismiss view controller and show TabBar with 5 Tab and Each Tab contain TabaleView. User select any row and navigate to sub view.

The issue is, on sub view I dont need tab bar. (TabBar is needed ONLY on dashboard). If I hide tabBar a white space remain there. Is there any workaround to solve this issue?

A: 

You need to use this method when you are pushing the viewController of your subview.

[viewController setHidesBottomBarWhenPushed:YES];

Hope this helps.

Thanks,

Madhup

Madhup
and where exactly I need to write this, On second screen where user tab on row Or on viewdid load of sub view?
iPhoneDev
just before you push the view controller, this is the easiest and simplest answer.
Jonathan
@iPhoneDev see the comment of Jonathan
Madhup
A: 

On subview write this mehthod:

Subview.m:

  • (BOOL)hidesBottomBarWhenPushed{ return TRUE; }

and in Subview.h

  • (BOOL)hidesBottomBarWhenPushed;

thats it, it has resolved the issue.

iPhoneDev
A: 

Put this method into your subview, where do you want hide the tababr.

Try this one.

 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {

     if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    // Custom initialization
   }
     self.hidesBottomBarWhenPushed = YES;
     return self;
    }

Best of Luck.

Pugal Devan