I'm implementing a UITabBar in the middle of my navigation stack without UITabBarController. The UITabBar is in the DetailViewController
which delegate a portion of the screen to the view controller associated with the selected tab element. Inside one of view controller's thats displayed via tab bar selection, there's a UIButton which needs to display a view modally. I tried [self presentModalViewController:modalNavController animated:YES];
, but the new navigation bar was hidden underneath the nav bar of the parent controller, DetailViewController
. So what I think I need to do is use the parent's navigation controller to present the view modally so that the new nav bar is ON TOP of the DetailViewController
nav bar.
I know its possible because I have an ad in the DetailViewController
, and tapping the add gives me the desired result, but I haven't been able to incorporate that code. I could also probably display the UIButton from the DetailViewController rather than the subView, but I need to use this pattern a few times, so I'd rather not have to work with an unorthodox hack like that.
THANKS!
EDIT
I have already tried adding the new view to a navigation controller and then presenting the navigation controller like so:
WriteReviewController *newReview = [[WriteReviewController alloc] initWithNibName:@"WriteReviewController" bundle:nil];
UINavigationController *modalNavController = [[UINavigationController alloc] initWithRootViewController:newReview];
// This is intended to be presented in another view controller class
modalNavController.navigationBar.barStyle = UIBarStyleDefault;
[self.parentViewController presentModalViewController:modalNavController animated:YES];
[modalNavController release];