“Hide” the Tab Bar When Pushing a View

后端 未结 3 771
暗喜
暗喜 2021-01-13 02:20

The New York Times iPhone application has a Tab Bar with five tab bar items. When you select the Latest tab, the app shows the title and abstract/summary in a UITableView.

3条回答
  •  旧时难觅i
    2021-01-13 02:43

    The view controller that is being pushed onto the navigation controller stack has its hidesBottomBarWhenPushed parameter set to yes. The code would look something like this in the table view's -didSelectRowAtIndexPath.

    NSDictionary *newsItem = [newsItems objectAtIndex:[indexPath row]];
    NewsDetailViewController *controller = [[NewsDetailViewController alloc] init];
    [controller setHidesBottomBarWhenPushed:YES];
    [controller setNewsItem:newsItem];
    [[self navigationController] pushViewController:controller animated:YES];
    [controller release], controller = nil;
    

    Take a look at the documentation for hidesBottomBarWhenPushed.

    p.s. You'll probably get more visibility on this question if you add the tag 'iphone' to it.

提交回复
热议问题