开发者

UIScrollView and presentModalViewController

I add UITa开发者_StackOverflow社区bleViewController in UIScrollView. When I call

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;
    [picker setSubject:@"Email"];
    [picker setMessageBody:currentcelltext isHTML:NO];
    [self presentModalViewController:picker animated:YES];
    [picker release];

MFMailComposeViewController is coming in UIScrollView. So, I can't press cancel and send button.

How to fix it ?


I hope that you set MessageUI.framework in your xcode project.. After you have to set delegate in .h file.. than , you have to create one more method..

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{
    [self becomeFirstResponder];
    [self dismissModalViewControllerAnimated:YES];
}


You might have fixed the issues. This answer is for those who might come to this post with the expectation of answer.

To fix this you have to use delegation pattern. I assume all the pages in your scrollview are viewcontroller instances and scrollview is subview to viewcontroller.

This answer https://stackoverflow.com/a/626946/451867 can help you to implement delegate pattern in your project,

You can read developer docs for more info - docs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜