在横向模式下启动/限制 iphone 应用内邮件

发布于 2024-08-21 01:01:28 字数 165 浏览 11 评论 0原文

我的应用程序是横向的。我想在横向启动应用程序内电子邮件编辑器并对其进行限制。谁能建议如何做到这一点?我创建了一个具有正确自动旋转设置的视图控制器,以使我的应用程序保持横向,但不确定如何告诉 MFMailComposeViewController 请以横向启动并保持在那里(并停止使键盘旋转)。

帮助?

My app is landscape. I would like to launch the in-app email composer in landscape and restrict it as such. Can anyone advise how to do this? I created a view controller with the proper auto-rotate settings to keep my app in landscape but am unsure how to tell the MFMailComposeViewController to please launch in landscape and stay there (and stop making the keyboard rotate).

Help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

五里雾 2024-08-28 01:01:29

这是回答他的评论,而不是原来的问题。
我也遇到了这个问题,这个片段似乎对我有用:

[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeLeft];

This is answering his comment and not the original question.
I had this problem as well and this snippet seems to work for me:

[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeLeft];
潦草背影 2024-08-28 01:01:29

首先在 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];


}

First Add following property in info.plist file

Supported interface orientations
"Landscape (right home button)"

than use 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];


}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文