views:

484

answers:

0

I'm using a UIViewController containing a UIView and a UINavigationBar on which there is two buttons (Cancel on the left, Save on the right).

This UIViewController is presented on the screen like this on top of a Tabbar based application:

[self presentModalViewController:(UIViewController *)myUIViewController animated:YES];

This works fine as this presented UIViewController is on top of everything and in that context this is exactly what I want (cliking on both button makes the UIViewController to dismiss itself with appropriate action).

But, I want to reuse this UIViewController by pushing it on the UIViewController stack in a UINavigation:

[self.navigationController pushViewController:(UIViewController *)myUIViewController animated:YES];

In that case, there is two UINavigationBar... one that is part of the UINavigation stack and the one included in the pushed UIViewController. I want in that case to hide the UINavigationBar in that specific context... and I want the UIView to "scroll" at that top to fill the blank left by the hiding of the UINavigationBar.

How can this be done ?