Question

I am using Monotouch storyboard for Iphone. I have a navigation controller and through code I am setting the navigationbarhidden to false or true on certain views. I am setting the visibility in ViewWIllAppear method and it is working.

Now I am trying the following code but it has no effect on the navigation bar. I want the navigation bar to fade in or do a transition effect. But it is not working..

this.NavigationController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve.

Anyone know how to solve this problem?

Was it helpful?

Solution

ModalTransitionStyle is using for other purpose.

Imaging you have 2 UIViewController, one of them is visible right now. You want to show modally second one with animation. Using ModalTransitionStyle property you could select one of predefined animation. For demo of these animations see that video.

UINavigationController have ModalTransitionStyle too cause it is subclass of UIViewController. Yet I beleave it's not corresponding to your desirable effect.

If you could use your custom code in StoryBoard-based project, try to hide UINavigationBar with animated flag equals to true:

// Second parameter - "animated"
NavigationController.SetNavigationBarHidden(true, true); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top