How to remove bottom bar from NavigationView/TableView
I have an app that has a TableView, NavigationView and TabBar running together. There is a bar along the bottom of the screen above the TabBar that looks exactly like the NavigationBar at the top of the screen. I have no idea what it is or how to get rid of it. Here is what it looks like with what I want gone crossed out: alt text http://www.jamespwright.com/images/public/tabandnavigationview.jpg
This is the structure of the Views: alt text http://www.jamespwright.com/images/public/tableviewstructure.jpg
Any idea what it is and how to get rid of it? It stays there when I navigate to my next view which is just a plain old View, nothi开发者_如何学运维ng special except that it displays some labels.
[self.navigationController setToolbarHidden:YES];
Here's more of an example:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
self.window = [[[UIWindow alloc] initWithFrame:CGRectMake(0,0,320,480)] autorelease];
RootViewController *rootViewController = [[[RootViewController alloc] initWithStyle:UITableViewStyleGrouped] autorelease];
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:rootViewController] autorelease];
navigationController.toolbarHidden = YES;
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
In Interface Builder under Table View Attributes (which you can find under Tools / Attributes Inspector), the third section is "Simulated User Interface Attributes". The last option is "Bottom Bar". Set it to None.
I discovered the answer because of haj1000's advice. That got me looking around the properties in Interface Builder and I noticed that when I clicked on the 2nd tab in the Tab Bar (which is set to a NavigationController rather than a ViewController) there was an option for "Shows Toolbar" that was checked. I turned that off and it worked. So Jordan's advice was correct, but I have no idea where to put Jordan's code in the application.
精彩评论