Code:
UINavigationController * childNaviVC = [[UINavigationController alloc] initWithRootViewController:self.subVC];
[self addChildViewController:childNaviVC];
[self.view addSubview:childNaviVC.view];
[childNaviVC.view setFrame:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
self.subVC.view.frame = childNaviVC.view.frame;
[childNaviVC.view addSubview:self.subVC.view];
[childNaviVC didMoveToParentViewController:self];
what i want to do is add a UINavigationController
(childNaviVC) as sub viewcontroller (subVC) of the designated VC, and use the UINavigationController
's root viewController to display the content;
the problem which i met is UINavigationController
's root view(subVC) size is consistent with UINavigationController
's parent VC
the red view size isn't equal to the cyan
thanks