我正在用cocos2d編寫遊戲。我想將MFMailComposeViewController添加到場景中。 因此,當我在場景中觸摸CcLabel時,郵件表被打開。如何使用cocos2d中的MFMailComposeViewController以橫向模式顯示郵件編輯器?
@interface EmailScene : CCScene <MFMailComposeViewControllerDelegate>
{
MFMailComposeViewController *picker;
}
-(void)displayComposerSheet;
@end
@implementation EmailScene
- (id) init {
self = [super init];
if (self != nil) {
[self displayComposerSheet];
}
return self;
}
-(void)displayComposerSheet
{
[[CCDirector sharedDirector] pause];
picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
[picker setToRecipients:toRecipients];
[[[CCDirector sharedDirector] openGLView] addSubview:picker.view];
[[CCDirector sharedDirector] stopAnimation];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
[[CCDirector sharedDirector] resume];
CCScene *Scene = [CCScene node];
CCLayer *Layer = [GameWinScreen node];
[Scene addChild:Layer];
[picker.view removeFromSuperview];
[[CCDirector sharedDirector] startAnimation];
[picker dismissModalViewControllerAnimated:YES];
[[CCDirector sharedDirector] replaceScene:Scene];
}
@end
alt text http://www.freeimagehosting.net/uploads/4a77b9ceb9.png
但是,問題是我的比賽是在橫向模式。所以,我需要郵件表以橫向模式顯示。但是,這裏的郵件表以縱向模式顯示。鍵盤出現在橫向模式下。但是,郵件集中表處於縱向模式。
我們如何才能改變「從我的iPhone發送」到「發送從我的iPad」
謝謝。
alt text http://www.freeimagehosting.net/uploads/3eb39ea1de.png
看起來這可能是Apple實施中的一個錯誤。你有沒有證實它在設備本身的方向錯誤? – 2010-07-08 23:18:51
我也有這個問題..我使用cocos2d 99.5 ...... sp ...開始賞金... – Rony 2010-11-23 11:37:21