Reputation: 4728
I am putting a UINavigationController
inside a container view like so (this in a full screen UIViewController
subclass):
UIViewController *litteViewController = [[UIViewController alloc]initWithNibName:nil bundle:nil];
UINavigationController *littleNavigator = [[UINavigationController alloc]initWithRootViewController:litteViewController];
UIView *containerView = [[UIView alloc]initWithFrame:CGRectMake(100.0, 100.0, 250.0, 320.0)];
littleNavigator.view.frame = containerView.bounds;
[self addChildViewController:littleNavigator];
[containerView addSubview:littleNavigator.view];
[self.view addSubview:containerView];
[littleNavigator didMoveToParentViewController:self];
Now this works as expected and littleViewController
appears in the rect I expect with a nav bar at top. Now let us say as a result of some interaction inside littleViewController
something like this happens
-(void)someButtonAction:(id)sender{
UIViewController *secondLittleViewController = [[UIViewController alloc]initWithNibName:nil bundle:nil];
[self.navigationController presentModalViewController:secondLittleViewController animated:YES];
}
unfortunately this subsequent controller winds up being presented full screen. Now I've done exactly this before inside popoverControllers
and splitViewControllers
and they've behaved exactly as I want this to, a navigation stack is built within the little rectangle it was started in.
How can I build a navigation stack inside a container over in an arbitrary CGRect?
Upvotes: 0
Views: 453
Reputation: 4218
On iPhone and iPod touch, the presented view is always full screen. So you need change to pushViewController
Glad I can help
Upvotes: 1