Question

I try to change the modalTransitionStyle property of my modal view. Every style work except for FlipHorizontal. If I choose this, nothing happens.

I have an UINavigationController which should be flipped in.

Heres the code:

            UINavigationController *loginNavCon = [[UINavigationController alloc] init];
            loginNavCon.navigationBar.barStyle = UIBarStyleBlack;
            // push login view
            LogInViewController *liVC = [[LogInViewController alloc] initWithStyle:UITableViewStyleGrouped];
            [loginNavCon pushViewController:liVC animated:NO];
            [liVC release];
            // show login view
            loginNavCon.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
            [self.window.rootViewController presentModalViewController:loginNavCon animated:YES];
            [loginNavCon release];

Thanks for your help.

Was it helpful?

Solution

Ok, I figured it out!

The point is to set it in the pushing UIViewController, not in the pushed one.

So in my example code it has to look like this:

UINavigationController *loginNavCon = [[UINavigationController alloc] init];
loginNavCon.navigationBar.barStyle = UIBarStyleBlack;
// push login view
LogInViewController *liVC = [[LogInViewController alloc] initWithStyle:UITableViewStyleGrouped];
[loginNavCon pushViewController:liVC animated:NO];
[liVC release];
// show login view
/** changed **/
self.window.rootViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
/*************/
[self.window.rootViewController presentModalViewController:loginNavCon animated:YES];
[loginNavCon release];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top