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

Iphone 如何自定义MFMailComposeViewController的导航栏颜色?,iphone,mfmailcomposeviewcontroller,Iphone,Mfmailcomposeviewcontroller,从这个代码将显示在原来的颜色我怎么能改变它为另一种颜色? 也许它需要被覆盖 MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init]; mail.mailComposeDelegate = self; if ([MFMailComposeViewController canSendMail]) { [mail setToRecipients:[NSArray arr

从这个代码将显示在原来的颜色我怎么能改变它为另一种颜色? 也许它需要被覆盖

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];
    }

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


MFMailComposeViewController
继承自
UINavigationController
。这意味着它将有一个
navigationBar
属性。一旦你有了导航栏,你就可以修改它的
tintColor
属性了。

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


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

实际上,iPhone SDK禁止您修改MFMailComposeViewController的外观。从文档()中:


抱歉…

事实上,iPhone SDK禁止您修改MFMailComposeViewController的外观。从文档()中:


很抱歉…

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

重要的

不能修改此视图显示的视图层次结构 控制器。但是,您可以自定义 接口使用UIAppearance协议


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

重要的

不能修改此视图显示的视图层次结构 控制器。但是,您可以自定义 接口使用UIAppearance协议


使用这种方法时,你需要小心。众所周知,苹果在提交到应用商店时对拒绝按钮非常满意。如果您修改标准iPhone界面(即mail Compobase界面),苹果可能会拒绝您的应用程序。如果用户界面不打算被修改,那么在使用这种方法时需要小心。众所周知,苹果在提交到应用商店时对拒绝按钮非常满意。如果您修改标准iPhone界面(即mail Compobase界面),苹果可能会拒绝您的应用程序。如果用户界面不打算被修改…界面本身是不可自定义的,这意味着改变导航栏的颜色?我不确定更改颜色是否会与修改邮件合成界面相冲突。这可能是真的,但实际上,我与苹果商店的人打交道的经验是,你不想给他们一个拒绝你的应用程序的借口。你可能可以重新着色导航栏,但如果它最终导致你的应用程序被拒绝,我不愿意为此投入大量时间…界面本身是不可自定义的,这意味着改变导航栏的颜色?我不确定更改颜色是否会与修改邮件合成界面相冲突。这可能是真的,但实际上,我与苹果商店的人打交道的经验是,你不想给他们一个拒绝你的应用程序的借口。你可能可以重新着色导航栏,但如果它最终导致你的应用被拒绝,我不愿意在这方面投入大量时间。。。
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.