我在我的应用程序中使用以下代码禁用了横向模式。:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
但是当邮件视图显示它以某种方式启用陆地横向模式时。
邮件操作代码:
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"Subject 1"];
UIImage *myImage = [UIImage imageNamed:@"logo_v22.png"];
NSData *imageData = UIImagePNGRepresentation(myImage);
[mailer addAttachmentData:imageData mimeType:@"image/png" fileName:@"mobiletutsImage"];
NSString *emailBody = @"Test ";
[mailer setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:mailer animated:YES];
}
主要问题:如何在 mailView 中禁用横向模式?
附加问题:如何更改 mailView 中按钮的颜色?(取消按钮和发送按钮)