hi,
i tried to insert a mail tool in my app.... my app is based on the
cocos2d engine
the Toolbar (at the top -cancel,send...) is visible but i can't see the other parts of the mfMailComposerViewController view :-(
code:
-(void)displayComposerSheet
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"my message"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"
[email protected]"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"
[email protected]", @"
[email protected]", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"
[email protected]"];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
// Attach an image to the email
UIImage *screenshot = [[Director sharedDirector] screenShotUIImage];
NSData *myData = UIImagePNGRepresentation(screenshot);
[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"AdMotiv"];
// Fill out the email body text
NSString *emailBody = @"test";
[picker setMessageBody:emailBody isHTML:NO];
[[picker view] setFrame:CGRectMake(0.0f,
0.0f,320.0f, 480.0f)];
[[picker view] setTransform:CGAffineTransformIdentity];
[[picker view] setBounds:CGRectMake(0.0f,
0.0f,320.0f, 480.0f)];
//[[[VariableStore sharedInstance] parentView] setTransform: CGAffineTransformIdentity];
//[[[VariableStore sharedInstance] parentView] setBounds : CGRectMake(0.0f,
0.0f, 480.0f, 320.0f)];
UITextField *textfeld = [[UITextField alloc] initWithFrame:CGRectMake(50.0f, 50.0f, 100.0f, 100.0f)];
[[picker view] addSubview:textfeld];
[[[VariableStore sharedInstance] window]addSubview:picker.view];
[[[VariableStore sharedInstance] window] makeKeyAndVisible];
[picker release];
}