I have a custom UINavigationController that draws a custom background. That navigation controller is already set when accessing self.navigationController on the root view controller. Now what I’d like to do is to push a new view controller but replace the navigation controller in the new view controller to a default one (without the custom background).
Basically the new view controller is presenting an image with the navigation bar being translucent. Because it reuses the navigation controller (with the custom background) from the root view controller, the end effect is translucent navigation bar with custom background.
I know I could replace the navigation bar when presenting the new view controller as a modal view. But can I replace it when pushing the new view controller?
I tried something like this but this code has no effect:
LTImageViewController* controller = [[LTImageViewController alloc] init];
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:self];
[navController pushViewController:controller animated:YES];
While pushing a view controller in UINavigationController it creates an stack, and i think we can not push an navigation controller in another.
You can do one thing show your viewController modally and change the TransitionStyle to UIModalTransitionStyleCoverVertical
Might Help