尽管我知道更改MFMailComposeViewController
已经开始,但我冒了一个风险。 我发现了一些想法,例如更改MFMailComposeViewController的标题
[self presentModalViewController:controller animated:YES]; // Existing line
[[[[controller viewControllers] lastObject] navigationItem] setTitle:@"SomethingElse"];
和
[[[[(MFMailComposeViewController*)vc navigationBar] items] objectAtIndex:0] setTitle:@" SomethingElse"];
,但奇怪的是,标题是“SomethingElse”像2秒钟,之后它返回到设置的主题。我也尝试过其他解决方案,但输出相同。
我正在使用SHK(ShareKit)连接到社交。这里是从showViewController
代码:
if ([vc respondsToSelector:@selector(modalPresentationStyle)])
vc.modalPresentationStyle = [SHK modalPresentationStyle];
if ([vc respondsToSelector:@selector(modalTransitionStyle)])
vc.modalTransitionStyle = [SHK modalTransitionStyle];
[topViewController presentModalViewController:vc animated:YES];
[[[[(MFMailComposeViewController*)vc navigationBar] items] objectAtIndex:0] setTitle:@" "];
[(UINavigationController *)vc navigationBar].barStyle =
[(UINavigationController *)vc toolbar].barStyle = [SHK barStyle];
self.currentView = vc;
检查SO发布 http://stackoverflow.com/questions/1737848/change-title-of-mfmailcomposeviewcontroller – Jhaliya