Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-02-2008, 04:05 PM   #1 (permalink)
New Member
 
Join Date: Jul 2008
Posts: 38
Default Hide tabBar

Hi,
I have an tabBar app, one tab consists of an navigation controller. When I push a view the tabBar should be hidden, just like in the ipod app. I tried this, but it doesn't work:

Code:
- (IBAction)MyBtnPressed {
   [[self navigationController] setHidesBottomBarWhenPushed:YES];
   [[self navigationController] pushViewController:[[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil] animated:YES];
}
Please help,
toom
toom is offline   Reply With Quote
Old 09-03-2008, 10:00 AM   #2 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 211
Default

Set the hide navigation controller member on the new view controller.
lapse is offline   Reply With Quote
Old 09-03-2008, 11:13 AM   #3 (permalink)
New Member
 
Join Date: Jul 2008
Posts: 38
Default

I put this in the NewViewController.m file:

Code:
- (void)awakeFromNib {
	self.navigationController.hidesBottomBarWhenPushed = YES;
}
But it doesn't work.
toom is offline   Reply With Quote
Old 09-03-2008, 11:14 AM   #4 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 211
Default

Set it on your NewViewController object. Not the navcontroller.
lapse is offline   Reply With Quote
Old 09-03-2008, 11:44 AM   #5 (permalink)
New Member
 
Join Date: Jul 2008
Posts: 38
Default

Sorry but I don't know what to do .
toom is offline   Reply With Quote
Old 09-03-2008, 12:16 PM   #6 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 211
Default

Sure you do.

Your NewViewController is a UIViewController, correct? There's a hidesBottomBarWhenPushed property. Set it and let the navcontroller handle the rest for you.
lapse is offline   Reply With Quote
Old 09-04-2008, 09:59 AM   #7 (permalink)
New Member
 
Join Date: Jul 2008
Posts: 38
Default

ahh thank you, i tried this before:
Code:
- (BOOL)hidesBottomBarWhenPushed{
	return TRUE;
}
but i forgot to add it to the .h file .
toom is offline   Reply With Quote
Old 11-21-2008, 01:50 AM   #8 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 370
Default

that method worked for me with out adding it in the .h file.

But I am using this way to hide

Code:
//Load the view
	AddViewController *aController = [[AddViewController alloc] init];
	
	//Set the view title
	aController.title = @"Add View";
	//hide tabbar
	aController.hidesBottomBarWhenPushed = YES;
	//add it to stack.
	[[self navigationController] pushViewController:aController animated:YES];
david_david is offline   Reply With Quote
Old 10-20-2009, 05:36 PM   #9 (permalink)
iPhone20
 
Join Date: Sep 2009
Posts: 140
Default Hide Tabbar

Hi,

Is there a way i can hide Tabbar controller on first 3 views and show it on the 4 view.
I am using navigation controller and it is a window based project.
I don't want Tabbar controller at all on first three view.

Thanks
apiphone is offline   Reply With Quote
Old 11-02-2009, 08:25 PM   #10 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 10
Default

Hi,

I'm having a similar issue.
I have a UITabBarController which is declared in the app delegate, and added to the window as a subview. Each tab in the tab bar controller has a view with a navigation controller and a table view. When I drill down to the last view on the stack (which is just a view, not a table view) I want to hide to tab bar so that I get a nice full screen.
I've tried setting the "hidesBottomBarWhenPushed" property to "YES" in the TableViewController Class, just before I push the detail view onto the stack like so:

detailController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:detailController animated:YES];

Unfortunately it doesn't do the trick. I'm guessing it might be because the tab bar controller is declared in the appdelegate or something of the sort.

Please help!
GabrielV. is offline   Reply With Quote
Old 02-12-2010, 11:04 AM   #11 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 3
Default hide tab bar solution

Try to hide it before and after the detail view get called.
That means you have to hidesBottomBarWhenPushed at the ViewDidLoad and ViewWillAppear methods.

Hope this helps, if you still have the issue.


Quote:
Originally Posted by GabrielV. View Post
Hi,

I'm having a similar issue.
I have a UITabBarController which is declared in the app delegate, and added to the window as a subview. Each tab in the tab bar controller has a view with a navigation controller and a table view. When I drill down to the last view on the stack (which is just a view, not a table view) I want to hide to tab bar so that I get a nice full screen.
I've tried setting the "hidesBottomBarWhenPushed" property to "YES" in the TableViewController Class, just before I push the detail view onto the stack like so:

detailController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:detailController animated:YES];

Unfortunately it doesn't do the trick. I'm guessing it might be because the tab bar controller is declared in the appdelegate or something of the sort.

Please help!
wannamobile is offline   Reply With Quote
Old 03-23-2010, 04:09 PM   #12 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 67
Default

I don't know how much this helps your specific problem, but I am trying to do the same thing.

I have made some progress but have not got the problem completely worked out yet.

but what I found is that if you put the following line of code in your "didSelectRowAtIndexPath" method of your UITableView, the viewController pushes the tabbar, but I can get it to reappear when I click to go back to the UITableView:

self.hidesBottomBarWhenPushed = YES; //put in didSelectRowAtIndexPath
scleland is offline   Reply With Quote
Old 03-23-2010, 05:02 PM   #13 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 67
Default

- (void)viewWillAppear: (BOOL)animated { self.hidesBottomBarWhenPushed = YES; }

- (void)viewWillDisappear: (BOOL)animated { self.hidesBottomBarWhenPushed = NO; }
scleland is offline   Reply With Quote
Old 03-24-2010, 09:14 AM   #14 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 67
Default

So here is the answer I came up with. Dont know if its exactly correct, but it works for my APP.

Put the following code in your "didSelectRowAtIndexPath" method (as apple likes to call it:

self.hidesBottomBarWhenPushed = YES;




Then add the following lines of code to your program:

- (void)viewWillDisappear: (BOOL)animated {
self.hidesBottomBarWhenPushed = NO;
}
scleland is offline   Reply With Quote
Old 02-01-2011, 10:11 AM   #15 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 10
Default Hmm. That doesn't work.

Quote:
Originally Posted by wannamobile View Post
Try to hide it before and after the detail view get called.
That means you have to hidesBottomBarWhenPushed at the ViewDidLoad and ViewWillAppear methods.

Hope this helps, if you still have the issue.
It didn't do the trick for me.. do you have any other suggestions?
Basically, I add the tab bar controller to the window in the app delegate. In each tab there's a view controller containing a navigation controller, which in turn displays a table view which can be drilled down. There's 3 levels in the table view, then there's a detail view. When the detail view is shown, I'd like to hide the tab bar.. still no luck. Please let me know if you have any sort of solution. And if you know a better way to display a tab bar with nav controllers and table views I'd like to hear that too. Thanks!!
GabrielV. is offline   Reply With Quote
Old 03-11-2011, 12:48 AM   #16 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 1
Default

Simple set hidesBottomBarWhenPushed of the subview before you push to it:

ShowDetails *showDetails = [[ShowDetails alloc] initWithNibName:@"ShowDetails" bundle:nil];
showDetails.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:showDetails animated:YES];
[showDetails release];
lpham is offline   Reply With Quote
Old 03-11-2011, 03:19 AM   #17 (permalink)
Registered Member
 
Join Date: Feb 2011
Location: Chicago, IL
Posts: 15
Default Hide tabbar in first view

Quote:
Originally Posted by lpham View Post
Simple set hidesBottomBarWhenPushed of the subview before you push to it:

ShowDetails *showDetails = [[ShowDetails alloc] initWithNibName:@"ShowDetails" bundle:nil];
showDetails.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:showDetails animated:YES];
[showDetails release];
Hi,

What about if I want to hide the tabbar in the first view that is loaded (for instance logon)?
Where do I put this piece of code in? AppDelegate?

Thanks
Gefthebest is offline   Reply With Quote
Old 03-11-2011, 03:30 AM   #18 (permalink)
Registered Member
 
Join Date: Oct 2009
Location: Amsterdam, The Netherlands
Posts: 782
Default

if you want an logoin page, I would suggest just present an viewcontroller modal on the first viewcontroller in your tabbarcontroller should do the trick.
__________________
If my answer helped you, you might want to help me.
Make a donation via PayPal.
TUX2K is offline   Reply With Quote
Old 03-11-2011, 03:51 AM   #19 (permalink)
Registered Member
 
Join Date: Feb 2011
Location: Chicago, IL
Posts: 15
Default

Quote:
Originally Posted by TUX2K View Post
if you want an logoin page, I would suggest just present an viewcontroller modal on the first viewcontroller in your tabbarcontroller should do the trick.
Oh yea I didn't know about modal view controllers, looks like exactly what I need...
However, when you say " in your tabbarcontroller should do the trick" thats reffering to the loction of the piece of code right?
Gefthebest is offline   Reply With Quote
Old 05-27-2011, 03:18 AM   #20 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 2
Default Try this

- (void)viewWillAppear: (BOOL)animated {
[super viewWillAppear:animated];
[self.tabBarController.tabBar setHidden:YES];
}

- (void)viewWillDisappear: (BOOL)animated {
[super viewWillDisappear:animated];
[self.tabBarController.tabBar setHidden:NO];
}
harshal.pandhe is offline   Reply With Quote
Old 01-22-2012, 05:58 PM   #21 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 1
Default great answer - worked!

That worked like a charm. thanks.

Quote:
Originally Posted by lpham View Post
Simple set hidesBottomBarWhenPushed of the subview before you push to it:

ShowDetails *showDetails = [[ShowDetails alloc] initWithNibName:@"ShowDetails" bundle:nil];
showDetails.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:showDetails animated:YES];
[showDetails release];
vbokser is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,758
Threads: 89,201
Posts: 380,569
Top Poster: BrianSlick (7,129)
Welcome to our newest member, dschivas
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:20 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0