我的应用是横向的。我想在横向启动应用内电子邮件编辑器并对其进行限制。谁能建议如何做到这一点?我创建了一个具有适当自动旋转设置的视图控制器,以使我的应用程序保持横向,但不确定如何告诉 MFMailComposeViewController 请以横向启动并保持在那里(并停止使键盘旋转)。
帮助?
首先在 info.plist 文件中添加以下属性
支持的界面方向“横向(右主页按钮)”
比使用 presentModalViewController
-(void)displayComposerSheet
{
MFMailComposeViewController *picker4 = [[[MFMailComposeViewController alloc]init]autorelease];
picker4.mailComposeDelegate = self;
[picker4 setSubject:result];
CGRect rect = CGRectMake(0,0,480,320);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[view.layer renderInContext:context];
// Fill out the email body text
[self presentModalViewController:picker4 animated:NO];
}
这是在回答他的评论,而不是最初的问题。 我也遇到了这个问题,这个片段似乎对我有用:
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeLeft];