我正在我的应用程序中使用MFMailComposeViewController来实现应用内邮件功能,但是我无法更改标题。默认情况下,它显示主题作为标题,但我想将标题设置为其他内容。我该怎么做?
我尝试过:
controller.title = @"Feedback";
但是它没有起作用。
这是我的代码:
- (IBAction)email {
NSArray *array = [[NSArray alloc] initWithObjects:@"myemail@gmail.com", nil];
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
[[controller navigationBar] setTintColor:[UIColor colorWithRed:0.36 green:0.09 blue:0.39 alpha:1.00]];
controller.mailComposeDelegate = self;
controller.title = @"Feedback";
[controller setSubject:@"Long subject"];
[controller setMessageBody:@""
isHTML:NO];
[controller setToRecipients:array];
[self presentModalViewController:controller animated:YES];
[controller release];
[array release];
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {
[self becomeFirstResponder];
[self dismissModalViewControllerAnimated:YES];
}
controller.topViewController.navigationItem.title = @"SomethingElse";
- user102008