如何从NavigationView / TableView中删除底栏

时间:2009-11-02 23:47:39

标签: iphone objective-c interface-builder

我有一个应用程序,它同时运行TableView,NavigationView和TabBar。 TabBar上方屏幕底部有一个条形,看起来与屏幕顶部的NavigationBar完全相同。我不知道它是什么或如何摆脱它。 以下是我想要划掉的内容: alt text http://www.jamespwright.com/images/public/tabandnavigationview.jpg

这是视图的结构: alt text http://www.jamespwright.com/images/public/tableviewstructure.jpg

知道它是什么以及如何摆脱它? 当我导航到我的下一个视图时,它就会停留在那里,这个视图只是一个普通的旧视图,除了显示一些标签之外没什么特别的。

3 个答案:

答案 0 :(得分:2)

[self.navigationController setToolbarHidden:YES];

以下是一个例子:

- (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];
}

答案 1 :(得分:0)

在“表视图属性”下的“界面构建器”(可以在“工具/属性”检查器下找到)中,第三部分是“模拟用户界面属性”。最后一个选项是“Bottom Bar”。将其设置为无。

答案 2 :(得分:0)

由于haj1000的建议,我发现了答案。这让我在Interface Builder中查看属性,我注意到当我单击Tab Bar中的第二个选项卡(设置为NavigationController而不是ViewController)时,有一个选中的“显示工具栏”已被选中。我把它关了,它起作用了。 所以Jordan的建议是正确的,但我不知道将Jordan的代码放在应用程序中的哪个位置。