Domanda

One of the view controllers in my iPad app is a questionnaire form. I'm trying to present it so that it appears in a childViewController modal segue just like the default segue for MFMailComposeViewController.

This is the look I am trying to achieve:

enter image description here

The code I am using doesn't seem to be working:

AskQuestionViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"AskQuestionViewController"];
[self addChildViewController:vc];
vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.splitViewController presentViewController:vc animated:YES completion:nil];
È stato utile?

Soluzione

Try:

AskQuestionViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"AskQuestionViewController"];
vc.modalPresentationStyle = UIModalPresentationPageSheet;
[self.splitViewController presentViewController:vc animated:YES completion:nil];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top