iphoneiosmodalviewcontrolleruimodaltransitionstyle

Display two modal view controllers one after another with different transition styles between them


I'm presenting a modalViewController with UIModalTransitionStyleCoverVertical and then, when the user selects a row of this modalView, I present another modalView as follows:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    CenterViewController *nextView = [[CenterViewController alloc] init];

    nextView.modalPresentationStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:nextView animated:YES];
    [nextView release];
}

The problem is that the transition style remains UIModalTransitionStyleCoverVertical no matter what type of transition style mode I initialize for this second modal view controller.

Am I missing something relevant? Thanks in advance.


Solution

  • UIModelPresentaionStyle is used to tell iOS you want it FullScreen or PageSheet..etc. , in your case you should use UIModelTransitionStyle .. so if you did like this it should work.

    nextView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;