views:

106

answers:

2

Hi all

Here is my problem, Im trying to present a modal view in front of a view with a Navigation Bar. I managed it fine with my Login modal view, which was presented by the RootView of my application. But this time the modal view is presented by one of the views of a CustomTabBarController (like in the Tweety app, I created it myself to be able to push it on the navigation stack, its a UIViewController which implement UITabBarDelegate). The problem is, it gets displayed behind the Nav Bar, which forces me to hide/unhide the nav bar when I present/dismiss the modal view, which result in a weird animation (I use the default animation for the modal view)

Do you guys have any idea about that ? How can I have the modal view displayed on top of everything else but the status bar ?

Thanks all

A: 

Did you try to represent it by using navigationController. [self.navigationController presentModalViewController:animated]. I think the problem is: your tabbar controller doesn't hold the navigationController so that the presenting doesn't work well

vodkhang
+1  A: 

That's it ! :D

I used this line to present the modal view :

[self presentModalViewController:writeMessageViewController animated:YES];

I replaced it by :

[[[[UIApplication sharedApplication] delegate] navigationController] presentModalViewController:writeMessageViewController animated:YES];

And it works perfectly ! Thank you very much :)

P.B