如何自定义MFMailComposeViewController的导航栏颜色?

时间:2010-03-08 08:03:51

标签: iphone mfmailcomposeviewcontroller

从此代码中将以原始颜色显示如何将其更改为其他颜色? 也许它需要被覆盖?

MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
    mail.mailComposeDelegate = self;
    if ([MFMailComposeViewController canSendMail]) {
        [mail setToRecipients:[NSArray arrayWithObjects:@"me@gmail.com",nil]];
        [mail setSubject:@"support"];
        [mail setMessageBody:@"enter your message here" isHTML:NO];
        [self presentModalViewController:mail animated:YES];
    }

3 个答案:

答案 0 :(得分:2)

我没有这样做,所以请谨慎对待这个答案。

MFMailComposeViewController继承自UINavigationController。这意味着它将拥有navigationBar属性。拥有navigationBar后,您可以修改其tintColor属性。

答案 1 :(得分:2)

实际上,iPhone SDK禁止您修改外观MFMailComposeViewController。来自文档(here):

Important: The mail composition interface itself is not customizable
and must not be modified by your application. In addition, after
presenting the interface, your application is not allowed to make 
further changes to the email content. The user may still edit the
content using the interface, but programmatic changes are ignored. 
Thus, you must set the values of content fields before presenting 
the interface.

...对不起

答案 2 :(得分:0)

Apple Docs中的更高版本的iOS开始,您应该使用UIAppearance协议

  

重要

     

您不得修改此视图显示的视图层次结构   控制器。但是,您可以自定义外观   界面使用UIAppearance协议。