【问题标题】:launch/restrict iphone inapp mail in landscape mode以横向模式启动/限制 iphone 应用程序邮件
【发布时间】:2010-02-09 23:28:38
【问题描述】:

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

帮助?

【问题讨论】:

  • 好的,所以我对控制器进行了子类化并正确设置了 shouldAutorotateToInterfaceOrientation ,这会调用邮件表以正确显示。但是,当我触摸邮件表时弹出的键盘有时会显示纵向,然后会旋转到横向并停留在那里。我如何告诉它不要竖起那个键盘?

标签: iphone email landscape restrict


【解决方案1】:

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

[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeLeft];

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-18
      • 2012-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-14
      相关资源
      最近更新 更多