我有一个在 iPod Touch/iPhone 上不应该旋转的应用程序。但是,我确实有一个 MFMaiComposeViewController 供用户发送错误报告。但是,我的应用程序是如何设置的,没有任何东西可以旋转,这很好,除了这个单一的视图。我怎样才能让它旋转到横向。它在一个类中声明,如下所示:
//
// LogbookSecondViewController.h
// Logbook iDM
//
// Created by Josiah Bruner on 9/20/12.
// Copyright (c) 2012 Infinite Software Technologies. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
@interface LogbookSecondViewController : UIViewController <MFMailComposeViewControllerDelegate>
{
MFMailComposeViewController *email;
}
@property (nonatomic, retain) MFMailComposeViewController *email;
@end
在他们中
- (IBAction)sendEmail:(id)sender {
NSLog(@"ToolsController - Send Email");
NSString *MailTO = @"infinite@qualityservice.com";
email = [[MFMailComposeViewController alloc] init];
email.mailComposeDelegate = self;
NSArray *recipitants = [NSArray arrayWithObject:MailTO];
// Subject
[email setSubject:@"Bug/Problem/Suggestion, Logbook iDM"];
[email setToRecipients:recipitants];
// Present it
[email setModalPresentationStyle:UIModalPresentationFormSheet];
[email setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentViewController:email animated:YES completion:nil];
}
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {
[email dismissViewControllerAnimated:YES completion:nil];
}
我怎样才能只允许这个视图旋转?谢谢。