Existing horizontal flip modal ViewController form factor

I am currently showing a modal UIViewController in the formSheet style, which was presented by coverVertical. I am trying to present another modal UIViewController from it using currentContext for presentation style and flipHorizontal for animation style. It really works, but there is a solid white white background behind the flip. Any advice on how to successfully introduce another model modular UIViewController using the flipHorizontal style from a pre-existing modal UIViewController in FormSheet format will be appreciated, please! thanks

the code:

// Loading of first modalVC - (void)showModalVC { Modal1VC *modal1VC = [[Modal1VC alloc] init]; modal1VC.modalPresentationStyle = UIModalPresentationFormSheet; modal1VC.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:modal1VC animated:YES]; [modal1VC release]; modal1VC.view.superview.bounds = CGRectMake(0, 0, 400, 400); } // Loading of second modalVC in Modal1VC - (void)buttonTapped:(id)sender { UIViewController *modal2VC = [[UIViewController alloc] init]; modal2VC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; modal2VC.modalPresentationStyle = UIModalPresentationCurrentContext; modal2VC.view.backgroundColor = [UIColor greenColor]; [self presentModalViewController:modal2VC animated:YES]; [modal2VC release]; modal2VC.view.superview.bounds = CGRectMake(0, 0, 400, 400); } 
+8
cocoa-touch ipad
source share
3 answers
 UIViewController *presentingViewController = //allocate your VC [modalViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; UIViewController *modalViewController = //your modal VC [presentingViewController presentModalViewController:modalViewController animated:YES]; 

This is the code you need;)

+4
source share

It looks like your transition is working, but is the problem with the white background displayed on the transition from the coup a problem?

During the flip, the white background that is displayed is actually window . You can change the color that is displayed by setting the backgroundColor window property in AppDelegate .

+1
source share

This may be a limitation of presentModalViewController:animated:

Instead of [self presentModalViewController:modal2VC animated:YES] you can get the desired effect using UIView animation. Maybe something like this:

 [UIView transitionWithView:self.view.window duration:0.3 options:UIViewAnimationOptionTransitionFlipFromRight animations:^{ [self presentModalViewController:modal2VC animated:NO]; } completion:NULL]; 
0
source share

All Articles