Iphone 更改MFMailComposeViewController的标题

Iphone 更改MFMailComposeViewController的标题,iphone,objective-c,ios,Iphone,Objective C,Ios,虽然我知道更改MFMailComposeViewController很困难,但我还是在冒险。 我发现了一些想法,比如 [self presentModalViewController:controller animated:YES]; // Existing line [[[[controller viewControllers] lastObject] navigationItem] setTitle:@"SomethingElse"]; 及 但奇怪的是,标题是“SomethingElse”

虽然我知道更改
MFMailComposeViewController
很困难,但我还是在冒险。 我发现了一些想法,比如

[self presentModalViewController:controller animated:YES]; // Existing line
[[[[controller viewControllers] lastObject] navigationItem] setTitle:@"SomethingElse"];

但奇怪的是,标题是“SomethingElse”,持续2秒,然后返回到设置的主题。我也尝试过其他解决方案,但输出结果相同

我正在使用SHK(共享套件)连接到社交网站。以下是来自
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;

我相信这是iOS4提供的某种保护

此处明确说明,您不得更改Apple提供的界面

重要提示:邮件合成界面本身是不可自定义的,不能由应用程序修改。此外,在显示界面后,不允许您的应用程序对电子邮件内容进行进一步更改。用户仍然可以使用界面编辑内容,但编程更改将被忽略。因此,在显示界面之前,必须设置内容字段的值。


我知道有些人因此而被拒绝。我只是想提醒你这一点。

我相信这是iOS4提供的某种保护

此处明确说明,您不得更改Apple提供的界面

重要提示:邮件合成界面本身是不可自定义的,不能由应用程序修改。此外,在显示界面后,不允许您的应用程序对电子邮件内容进行进一步更改。用户仍然可以使用界面编辑内容,但编程更改将被忽略。因此,在显示界面之前,必须设置内容字段的值。


我知道有些人因此而被拒绝。我只是想提醒你这一点。

你只需要设置邮件主题。表示
[MFMailComposeViewController设置主题:@“yourTitle”]
。然后,这将显示为标题。但是如果您没有在
MFMailComposeViewController
主题中写入任何内容,则默认情况下,它可以显示“新邮件”。

您只需设置邮件主题即可。表示
[MFMailComposeViewController设置主题:@“yourTitle”]
。然后这将显示为一个标题。但是如果您没有在
MFMailComposeViewController
主题中写入任何内容,则默认情况下,它可以显示“新消息”。

检查SO帖子检查SO帖子感谢您的回复。。我想我会坚持不修改任何东西:)这就是我讨厌苹果的原因。如果他们不能让我们定制界面,他们至少应该提供一些看起来不错的东西。现在我的标题看起来像“来自克莱的查询…”。这么难看的标题:-谢谢你的回复。。我想我会坚持不修改任何东西:)这就是我讨厌苹果的原因。如果他们不能让我们定制界面,他们至少应该提供一些看起来不错的东西。现在我的标题看起来像“来自克莱的查询…”。这么难看的标题:-@
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;