MFMailComposeViewController를 사용하는 데 문제가 있습니다.MFMailComposeViewController 자체가 올바르게 표시되지 않습니다.
http://postimg.org/image/i24gn4oi7/
을하지만 그렇게되면이 문제가 발생합니다 :
나는 버튼을 클릭하면, MFMailComposeViewController의 인스턴스 자체를 제시한다 여기
http://postimg.org/image/kdwm0isrl/
코드입니다 : 를- (IBAction)actionEmailComposer {
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
NSMutableArray *email = [[NSMutableArray alloc] initWithObjects:@"[email protected]", nil];
[mc setToRecipients:email];
//[mc setSubject:@"SUBJECT_HERE"];
[mc setMessageBody:@"Referência: \nCor:" isHTML:NO];
mc.modalPresentationStyle = UIModalPresentationFullScreen;
// Present mail view controller on screen
[self presentViewController:mc animated:YES completion:NULL];
}
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
break;
case MFMailComposeResultSent:
{
NSLog(@"Mail sent");
UIAlertView *msg = [[UIAlertView alloc] initWithTitle:@"Obrigado!" message:@"Logo logo entraremos em contato!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[msg show];
}
break;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure: %@", [error localizedDescription]);
break;
default:
break;
}
[self dismissViewControllerAnimated:YES completion:NULL];
}
사실, iPad에서는 제대로 작동하지만, iPhone에서만 발생합니다! 무슨 일 이니? 내가 도대체 뭘 잘못하고있는 겁니까?
미리 감사드립니다.
귀하의 질문을 이해하게하십시오. 컨트롤러가 http://postimg.org/image/i24gn4oi7/ 이미지로 나타나길 원하지만, http://postimg.org/image/kdwm0isrl/... 질문입니다. – Sabby
아니요, MFMailComposeViewController를 열려고 시도하면 올바르게 열리지 않는보기가 열리고 앞면에 그대로 있으면 뒤로 밀어야합니다. . 알았다? : D @Sabby –