MFMailComposeViewController取消按钮显示带有背景透明错误的弹出窗口

时间:2014-03-05 01:40:11

标签: ios mfmailcomposeviewcontroller

我使用MFMailComposeViewController并且发送邮件中的屏幕有2个按钮(左侧取消,右侧发送),当点击“取消”按钮时,它将在屏幕底部显示弹出窗口。这个错误是:弹出背景错误的弹出窗口,弹出窗口中的按钮项位置错误。

请帮助我查看这个错误:

https://drive.google.com/file/d/0B0e4fb-676YSa0wxZVFBVFNHRDA/edit?usp=sharing

非常感谢

此错误的代码

- (void) didClickShareButton:(UIButton*)btnShare{

    if([MFMailComposeViewController canSendMail] == YES) // device can send email
    {
        MFMailComposeViewController *mailComposer = [MFMailComposeViewController new];

        [mailComposer setSubject:EMAIL_TITLE];

        if([self.arrInviteEmployeeSelected count] > 0)
        {
            __block NSMutableArray *arrEmail    =   [[NSMutableArray alloc] init];
            [self.arrInviteEmployeeSelected enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                InviteEmployee *item    =   (InviteEmployee *)obj;

                [arrEmail addObject:item.email];
            }];


            [mailComposer setToRecipients:nil];
            [mailComposer setCcRecipients:nil];
            [mailComposer setBccRecipients:arrEmail];

            [arrEmail release];
        }

        [mailComposer setMessageBody:[NSString stringWithFormat:@"%@%@", EMAIL_CONTENT, USER_FULL_NAME] isHTML:NO];

        mailComposer.mailComposeDelegate = self;

        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
        {
            [self.navigationController presentViewController:mailComposer animated:YES completion:^{
                [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
            }];
        }
        else
        {
            [self presentModalViewController:mailComposer animated:YES];
        }


        [mailComposer release];
    }
    else // deivice cannot send email
    {
        [MBUtils showAlertSystemViewWithMessage:@"Sorry, Your deivce cannot send an email"];
    }

}


- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
    [self dismissModalViewControllerAnimated:YES];
    if(error)
    {
        [MBUtils showAlertSystemViewWithMessage:error.description];
    }
    else if (result == MFMailComposeResultSent)
    {

        LeftTabbarViewController *controller    =   (LeftTabbarViewController *)self.viewDeckController.leftController;
        [controller handleUserClickOnTableViewAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]];

        NotifPost(NOTIFICATION_REQUIRED_OPEN_LEFT_MENU);

    }
}

0 个答案:

没有答案