How to change modalTransitionStyle?

I am currently using this code to display an info window

-(IBAction)showInfo:(id)sender { InfoView *info = [[InfoView alloc] initWithNibName:nil bundle:[NSBundle mainBundle]]; [self presentModalViewController:info animated:YES]; [info release]; }

It currently uses the default transition style, UIModalTransitionStyleCoverVertical, and I would like it to use a different transition style like UIModalTransitionStyleFlipHorizontal, how to do this?

+3
source share
2 answers

from the Apple documentation http://developer.apple.com/iphone/library/samplecode/AddMusic/Listings/Classes_MainViewController_m.html#//apple_ref/doc/uid/DTS40008845-Classes_MainViewController_m-DontLinkElementID_6

MusicTableViewController *controller = [[MusicTableViewController alloc] initWithNibName: @"MusicTableView" bundle: nil];
controller.delegate = self;

controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

[self presentModalViewController: controller animated: YES];
[controller release];
+5
source
- (IBAction)next {
page2 *page2_xib = [[page2 alloc] init];
page2_xib.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
//page2_xib.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
//page2_xib.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
//page2_xib.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:page2_xib animated:YES];
}
+1
source

Source: https://habr.com/ru/post/1761448/


All Articles