tags:

views:

371

answers:

2

Apple provides the code to use MFMailComposeViewController.but it uses

  • (IBAction)buttonPressed {

    MFMailComposeViewController *controller = [[MFMailComposeViewController alloc]init];
    

    controller.mailComposeDelegate = self;

    [controller setSubject:@"In app email..."];

    [controller setMessageBody:@"...a tutorial from mobileorchard.com" isHTML:NO];

    [self presentModalViewController:controller animated:YES];

    [controller release];

} by default it uses bottom UP transition.suppose if i want to use following, it gives wrong ouput.can i use other add subview like that instead of presentModalViewController

{

    UIViewAnimationTransition  trans =  UIViewAnimationTransitionFlipFromRight;

[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition:trans forView: [self view] cache: YES];
    [self presentModalViewController: controller animated:YES];
[UIView commitAnimations];
}

it works correctly for other view controller,but it did not work in MFMailComposeViewController any help please?

hi i have done like this,but current view controller flips, and then composer comes from bottom..?will you help? - (IBAction)clickedMailButton:(id)sender

{

if ([MFMailComposeViewController canSendMail]) {

      MFMailComposeViewController *mcontroller = [[MFMailComposeViewController alloc]init];
 //[mcontroller setSubject:@"My Pocket Schedule"];
 [mcontroller setTitle:@"New Message"];
 [mcontroller setMessageBody:@"Check out My Pocket Schedule in the iTune Store" isHTML:NO];
 mcontroller.mailComposeDelegate = self;
 UIViewAnimationTransition  trans =  UIViewAnimationTransitionFlipFromRight;
 [UIView beginAnimations: nil context: nil];
 [UIView setAnimationTransition:trans forView: [self view] cache: YES];
 [self presentModalViewController:mcontroller animated:YES];
 [UIView commitAnimations];
 [mcontroller release];
}
A: 

Try

presentModalViewController:withTransition:

Jordan
A: 

Use the modalTransitionStyle property:

MFMailComposeViewController *mcontroller = [[MFMailComposeViewController alloc] init];
[mcontroller setTitle:@"..."];
[mcontroller setMessageBody:@"..." isHTML:NO];
mcontroller.mailComposeDelegate = self;
mcontroller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:mcontroller animated:YES];
[mcontroller release];
Ole Begemann
i did it exactly..it did not work
Mikhail Naimy
it did not work in MFMailComposer's presentModalViewController..have u checked pls?
Mikhail Naimy
Yes, I have checked it and it worked as expected.
Ole Begemann
pls check my code which is in last ( i have edited my question)...i tried... will you help please?
Mikhail Naimy
Even in your edited sample code, you have not done what I suggested. I have edited my answer to give a little more context.
Ole Begemann