我正在尝试获得基于导航的功能来显示不同的表格视图,但没有运气。本质上,用于的视图initWithRootViewController没有正确显示,但导航栏是。这是with hierarchy -> ->viewDidLoad方法中的代码:TimerViewControllerAppDelegateViewControllerTimerViewController
incidentTableViewController = [[IncidentTableViewController alloc] initWithStyle:UITableViewStyleGrouped];
    [incidentTableViewController.tableView.backgroundView setBackgroundColor:[UIColor colorWithRed:167.0/255.0 green:169.0/255.0 blue:172.0/255.0 alpha:1.0]];
    [incidentTableViewController.view setFrame:CGRectMake(0, 0, 268, 423)];
    [incidentTableViewController.tableView showsVerticalScrollIndicator];
    [incidentTableViewController setTitle:@"Incidents"];
    [incidentTableViewController.navigationController setNavigationBarHidden:NO];
    UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:incidentTableViewController];
    [controller.view setFrame:CGRectMake(268, 0, 268, 423)];
    [controller.view setBackgroundColor:[UIColor clearColor]];
    [controller.navigationController setNavigationBarHidden:YES];
    //[controller.view addSubview:incidentTableViewController.view];
    [self.view addSubview:controller.view];
这导致(我不确定为什么导航栏上方也有间隙):

如果我取消注释倒数第二行[controller.view addSubview:incidentTableViewController.view];,我会得到这个结果,这是根据需要减去导航栏:

我想要实现的是第二个带有导航栏的图像,有什么想法吗?
