Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

roeik

macrumors member
Original poster
Dec 25, 2008
80
0
Hi,

Inside the rootviewcontroller of a navigation controller, I am calling a modal view controller, like this:

Code:
   picker.navigationBar.barStyle = UIBarStyleDefault; 
   [self presentModalViewController:picker animated:YES];

The problem is that the navigationbar of the modal view controller (picker in my case) goes under the existing navigation bar, instead of on top of it.

I tried everything but I can't figure out what is the problem. Any ideas?

Thank you.
 
That is because you are calling on the view that is contained inside the navigation controller, meaning that the view is behind the nav controller.
 
That is because you are calling on the view that is contained inside the navigation controller, meaning that the view is behind the nav controller.


So what do I do?

I tried to this, but nothing happens.
Code:
 [self.navigationController presentModalViewController:picker animated:YES];
 
I just created a sample project that does just that a nav controller, with the code to present a modal view in the root view controller. I used
Code:
[self presentModalViewController: animated: ];
as you did in your first post and it worked just fine.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.