Vic320
Vic320

Reputation: 1105

Modal view not displaying properly

I am writing an iPad app and want to put an option on the home screen (root view controller) to allow users to e-mail feedback. I would like the mail to appear with the style "UIModalPresentationFormSheet". However, when I run the code, it appears full screen. What am I doing wrong? Here is the code I am using:

    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;
    NSArray *toAddresses = [[NSArray alloc] initWithObjects:@"[email protected]", nil];
    [picker setToRecipients:toAddresses];
    [toAddresses release];              
    [picker setSubject:@"App Feedback"];
    self.modalPresentationStyle = UIModalPresentationFormSheet;
    [self presentModalViewController:picker animated:YES];
    [picker release];

Upvotes: 0

Views: 453

Answers (2)

Nathanial Woolls
Nathanial Woolls

Reputation: 5291

You need to set modalPresentationStyle on your new view controller, not self.

Upvotes: 2

Daniel
Daniel

Reputation: 22395

You must set the style of the viewController being presented, not on the one presenting it.. So set the property of the MFMailComposeViewController and you should be ok.

Upvotes: 2

Related Questions