如何在横向iPhone应用程序中运行电子邮件/短信?
我有一个iPhone应用程序,它只在横向模式下运行,但最近我想添加邮件/短信/脸谱特征(通过UIButton操作)。最后一个运行平稳,我启动网络浏览器(本身管理人像模式),但启动邮件或短信作曲使我疯狂。 我只想在横向模式下使用这个应用程序,不包括启动邮件/短信/ FB(实际上是浏览器)。如何在横向iPhone应用程序中运行电子邮件/短信?
我管理有景观应用画面时有邮件/短信作曲家在纵向模式,但键盘出现在风景太,这是阻止作曲家的左/右一半 - 与[composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
任我做到了“M有关这个主题的读书不好的东西,或者说我只是失明) - 无论哪种方式,任何需要帮助,感谢
编辑:
我有重写根视图控制器:
- (BOOL)shouldAutorotateToInterfaceOrientation
在两种风景模式下返回YES。这个rootVC启动了ShareVC,它有3个按钮用于邮件/短信/光盘。我希望达到像启动纵向浏览器一样的浏览器。与邮件&短信一样,但使用模式视图控制器,然后在发送邮件/短信后返回ShareVC ...
我还设置了plist中的方向为横向模式。希望这澄清什么,我试图做:)
问题固定:) 原来我打电话目前/解雇modalViewController在childVC不是rootVC本身,这里是代码片段:
-(IBAction)goMail{
NSLog(@"gomail...");
MFMailComposeViewController *picker = [[[MFMailComposeViewController alloc] init] autorelease];
NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
if ([MFMailComposeViewController canSendMail]) {
picker.mailComposeDelegate = self;
[picker setSubject:@"Hello iPhone!"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
[picker setToRecipients:toRecipients];
[picker setMessageBody:@"mail content..." isHTML:NO];
[self.controller presentModalViewController:picker animated:YES];
//[picker release];
}
}
这里是我找到的地方[溶液(http://www.iphonedevsdk.com/forum/iphone-sdk-development/76670-getting-modal-view-controller-display-landscape-orientation.html) – raistlin 2012-04-03 11:29:19
尝试添加该所需的ViewController:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return interfaceOrientation==UIInterfaceOrientationLandscapeLeft;
}
我没有在Mac附近,所以有可能是个错误。
希望它有助于
OK,如果有人知道如何在风景应用程序中以横向模式启动邮件/短信作曲家 - 这也会令人满意 – raistlin 2012-04-03 10:05:23