FilterViewController *filter = [[FilterViewController alloc]init];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:filter];
[nav.view setFrame:CGRectMake((40/375.0) * WIDTH, 0, WIDTH - (40/375.0) * WIDTH, HEIGHT)];
[self.navigationController addChildViewController:nav];
[self.navigationController.view addSubview:nav.view];
在点击第二个导航的返回按钮时要
[self.navigationController.view removeFromSuperview];
[self.navigationController removeFromParentViewController];
点击第一个控制器的空白时要记得
for (UIView *vv in self.navigationController.childViewControllers) {
NSLog(@"%@",vv.class);
if ([vv isKindOfClass:[UINavigationController class]]) {
UINavigationController *na = (UINavigationController *)vv;
[na removeFromParentViewController];
[na.view removeFromSuperview];
}
}