0

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에서만 발생합니다! 무슨 일 이니? 내가 도대체 ​​뭘 잘못하고있는 겁니까?

미리 감사드립니다.

+0

귀하의 질문을 이해하게하십시오. 컨트롤러가 http://postimg.org/image/i24gn4oi7/ 이미지로 나타나길 원하지만, http://postimg.org/image/kdwm0isrl/... 질문입니다. – Sabby

+0

아니요, MFMailComposeViewController를 열려고 시도하면 올바르게 열리지 않는보기가 열리고 앞면에 그대로 있으면 뒤로 밀어야합니다. . 알았다? : D @Sabby –

답변

0

메일보기 컨트롤러를 표시하는보기 컨트롤러는 전체 화면이어야하며 앞면이 아닌 경우보기의 일부가 제대로 반응하지 않고 제대로 표시되지 않습니다. 당신은 본다).

+0

하지만 iPad와 iPhone은 같은 코드입니다. iPhone에서 작동하는 이유는 무엇입니까? 정말 기괴합니다. 그것은 일어나서는 안됩니다! –

+0

iPhone 및 iPad에서 모달 프레젠테이션이 매우 다르게 처리되면 화면상의 차이를 볼 수 있습니다. – Wain

+0

예, 알고 있습니다. 하지만 내가 해결하도록 도와 줄 수 있니? 내 코드에 문제가 있습니까? –