I use the code below in the root view controller to hide the UITableView header (there is a UISearchbar in the header). It works when the application starts and displays a tableView. However, subsequently, when the row is selected, the detailed view is clicked and the user pushes the detailed view, the uitableview header is now displayed in the root view, and this is not what I expected.
Here are the relevant functions:
- (void) viewWillAppear:(BOOL)animated { [self.navigationController setNavigationBarHidden:YES animated:animated]; [super viewWillAppear:animated]; self.tableView.contentOffset = CGPointMake(0, self.tableView.tableHeaderView.frame.size.height);
String '[self.navigationController setNavigationBarHidden: YES animated: animated];' certainly part of the problem, since the code works without it, and the tableView title scrolls out of view. However, the requirement for the root view is that the navigation bar is hidden, but is displayed in the detail view.
source share